摘要:
Length of Last WordGiven a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the strin... 阅读全文
摘要:
Longest WordsGiven a dictionary, find all of the longest words in the dictionary.ExampleGiven{ "dog", "google", "facebook", "internationalization"... 阅读全文
摘要:
Write a method to replace all spaces in a string with %20. The string is given in a characters array, you can assume it has enough space for replaceme... 阅读全文
摘要:
Number of IslandsGiven a boolean 2D matrix, find the number of islands.ExampleGiven graph:[ [1, 1, 0, 0, 0], [0, 1, 0, 0, 1], [0, 0, 0, 1, 1], [0,... 阅读全文
摘要:
Invert Binary TreeInvert a binary tree.Example 1 1 / \ / \2 3 => 3 2 / \ 4 4ChallengeDo it in recursion is accept... 阅读全文
摘要:
Reverse Linked ListReverse a linked list.ExampleFor linked list 1->2->3, the reversed linked list is 3->2->1ChallengeReverse it in-place and in one-pa... 阅读全文
摘要:
Binary Tree Postorder TraversalGiven a binary tree, return thepostordertraversal of its nodes' values.Given binary tree{1,#,2,3}, 1 \ 2 / ... 阅读全文
摘要:
Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.Given binary tree{1,#,2,3}, 1 \ 2 / 3r... 阅读全文
摘要:
Binary Tree Preorder TraversalGiven a binary tree, return the preorder traversal of its nodes' values.Given: 1 / \ 2 3 / \4 5return [1,2,4,5... 阅读全文
摘要:
Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11... 阅读全文