摘要:
Single Number IIGiven an array of integers, every element appearsthreetimes except for one. Find that single one.Note:Your algorithm should have a lin... 阅读全文
摘要:
LRU CacheDesign and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get... 阅读全文
摘要:
Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -... 阅读全文
摘要:
Copy List with Random PointerA linked list is given such that each node contains an additional random pointer which could point to any node in the lis... 阅读全文
摘要:
Word BreakGiven a stringsand a dictionary of wordsdict, determine ifscan be segmented into a space-separated sequence of one or more dictionary words.... 阅读全文
摘要:
Binary Tree Preorder TraversalGiven a binary tree, return thepreordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ... 阅读全文
摘要:
Binary Tree Postorder TraversalGiven a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \... 阅读全文
摘要:
Reverse Words in a StringGiven an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click... 阅读全文
摘要:
Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given... 阅读全文
摘要:
Find Minimum in Rotated Sorted Array IIFollow up for "Find Minimum in Rotated Sorted Array": What if duplicates are allowed?Would this affect the run-... 阅读全文