摘要:
156. Binary Tree Upside Down Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same pare 阅读全文
摘要:
图论的常见题目有两类,一类是求两点间最短距离,另一类是拓扑排序,两种写起来都很烦。 求最短路径: 127. Word Ladder Given two words (beginWord and endWord), and a dictionary's word list, find the leng 阅读全文
摘要:
12. Integer to Roman Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. [leetcode] 12. Intege 阅读全文
摘要:
94. Binary Tree Inorder Traversal Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], 阅读全文
摘要:
链表: 61. Rotate List Given a list, rotate the list to the right by k places, where k is non-negative. For example:Given 1->2->3->4->5->NULL and k = 2,r 阅读全文
摘要:
75. Sort Colors Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in 阅读全文
摘要:
71. Simplify Path Given an absolute path for a file (Unix-style), simplify it. For example,path = "/home/", => "/home"path = "/a/./b/../../c/", => "/c 阅读全文
摘要:
动态规划属于技巧性比较强的题目,如果看到过原题的话,对解题很有帮助 55. Jump Game Given an array of non-negative integers, you are initially positioned at the first index of the array. 阅读全文
摘要:
一般用dfs来做 最简单的一种: 17. Letter Combinations of a Phone Number Given a digit string, return all possible letter combinations that the number could represe 阅读全文