02 2016 档案
摘要:原题链接在这里:https://leetcode.com/problems/walls-and-gates/ 题目: You are given a m x n 2D grid initialized with these three possible values. -1 - A wall or
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/factor-combinations/ 题目: Numbers can be regarded as product of its factors. For example, Write a function that t
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/flatten-2d-vector/ 题目: Implement an iterator to flatten a 2d vector. Example: Input: 2d vector = [ [1,2], [3], [
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/group-shifted-strings/ 题目: Given a string, we can "shift" each of its letter to its successive letter, for examp
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/meeting-rooms-ii/ 题目: Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/meeting-rooms/ 题目: Given an array of meeting time intervals consisting of start and end times [[s1,e1],[s2,e2],.
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/one-edit-distance/ 题目: Given two strings s and t, determine if they are both one edit distance apart. Note: Ther
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-upside-down/ 题目: Given a binary tree where all the right nodes are either leaf nodes with a sibling
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/binary-search-tree-iterator/ 题目: Implement an iterator over a binary search tree (BST). Your iterator will be in
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/inorder-successor-in-bst/ 题目: Given a binary search tree and a node in it, find the in-order successor of that n
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/number-of-islands-ii/ 题目: A 2d grid map of m rows and n columns is initially filled with water. We may perform a
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/closest-binary-search-tree-value-ii/ 题目: Given a non-empty binary search tree and a target value, find k values
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/closest-binary-search-tree-value/ 题目: Given a non-empty binary search tree and a target value, find the value in
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-increasing-path-in-a-matrix/ 题目: Given an integer matrix, find the length of the longest increasing path
阅读全文
摘要:原题链接在这里:http://www.lintcode.com/en/problem/subtree/ You have two every large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes.
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/count-univalue-subtrees/ 题目: Given a binary tree, count the number of uni-value subtrees. A Uni-value subtree me
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/largest-bst-subtree/ 题目: Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), wher
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/wiggle-sort-ii/ 题目: Given an unsorted array nums, reorder it such that nums[0] < nums[1] > nums[2] < nums[3]....
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/wiggle-sort/ 题目: Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nu
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shortest-word-distance-iii/ 题目: This is a follow up of Shortest Word Distance. The only difference is now word1
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shortest-word-distance-ii/ 题目: This is a follow up of Shortest Word Distance. The only difference is now you are
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shortest-word-distance/ 题目: Given a list of words and two words word1 and word2, return the shortest distance be
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/flip-game-ii/ 题目: You are playing the following Flip Game with your friend: Given a string that contains only th
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/flip-game/description/ 题目: You are playing the following Flip Game with your friend: Given a string that contain
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/ 题目: Given a string, find the length of the longest subst
阅读全文