摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文
摘要:
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 阅读全文