摘要:
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled u... 阅读全文
摘要:
Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Update (2014-11-02):The s... 阅读全文
摘要:
Given an absolute path for a file (Unix-style), simplify it.For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c"click to show corn... 阅读全文
摘要:
Given an unsorted array, find the maximum difference between the successive elements in its sorted form.Try to solve it in linear time/space.Return 0 ... 阅读全文
摘要:
As the title described, you should only use two stacks to implement a queue's actions.The queue should support push(element), pop() and top() where po... 阅读全文
摘要:
Given two values k1 and k2 (where k1 searchRange(TreeNode root, int k1, int k2) {19 ArrayList res = searchRangeRecur(root,k1,k2);20 r... 阅读全文
摘要:
Given n items with size A[i] and value V[i], and a backpack with size m. What's the maximum value can you put into the backpack?NoteYou cannot divide ... 阅读全文
摘要:
Given an array of integers, find the subarray with smallest sum.Return the sum of the subarray.NoteThe subarray should contain at least one integer.Ex... 阅读全文
摘要:
Given a string which contains only letters. Sort it by lower case first and upper case second.NoteIt's not necessary to keep the original order of low... 阅读全文
摘要:
Given two strings, find the longest comment subsequence (LCS).Your code should return the length of LCS.ExampleFor "ABCD" and "EDCA", the LCS is "A" (... 阅读全文