摘要:
Given a nested list of integers, returns the sum of all integers in the list weighted by their depthFor example, given the list {{1,1},2,{1,1}} the fu... 阅读全文
摘要:
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S="ADOBECODEBA... 阅读全文
摘要:
Given two words (beginWordandendWord), and a dictionary's word list, find the length of shortest transformation sequence frombeginWordtoendWord, such ... 阅读全文
摘要:
Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given[10, 9, 2, 5, 3, 7, 101, 18],The longest incre... 阅读全文
摘要:
Find thekth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For exampl... 阅读全文
摘要:
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2]have the following unique perm... 阅读全文
摘要:
Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top()... 阅读全文
摘要:
There are a row ofnhouses, each house can be painted with one of thekcolors. The cost of painting each house with a certain color is different. You ha... 阅读全文
摘要:
There is a fence with n posts, each post can be painted with one of the k colors.You have to paint all the posts such that no more than two adjacent f... 阅读全文
摘要:
Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front o... 阅读全文