摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 这道题很简单也很经典感觉。一开始用hashset做的,但这样就用了extra s 阅读全文
posted @ 2017-01-19 11:13 璨璨要好好学习 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文
posted @ 2017-01-19 10:48 璨璨要好好学习 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s 阅读全文
posted @ 2017-01-19 08:18 璨璨要好好学习 阅读(136) 评论(0) 推荐(0) 编辑
摘要: Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string 阅读全文
posted @ 2017-01-19 06:04 璨璨要好好学习 阅读(156) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction 阅读全文
posted @ 2017-01-19 00:07 璨璨要好好学习 阅读(126) 评论(0) 推荐(0) 编辑