09 2017 档案
摘要:原题链接在这里:https://leetcode.com/problems/predict-the-winner/description/ 题目: Given an array of scores that are non-negative integers. Player 1 picks one
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/partition-equal-subset-sum/description/ 题目: Given a non-empty array containing only positive integers, find if t
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shopping-offers/description/ 题目: In LeetCode Store, there are some kinds of items to sell. Each item has a price
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/target-sum/description/ 题目: You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/bomb-enemy/description/ 题目: Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the numb
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/sentence-screen-fitting/ 题目: Given a rows x cols screen and a sentence represented by a list of non-empty words,
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/android-unlock-patterns/description/ 题目: Given an Android 3x3 key lock screen and two integers m and n, where 1
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/integer-break/description/ 题目: Given a positive integer n, break it into the sum of at least two positive intege
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/count-numbers-with-unique-digits/description/ 题目: Given a non-negative integer n, count all numbers with unique
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/palindromic-substrings/description/ 题目: Given a string, your task is to count how many palindromic substrings in
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/out-of-boundary-paths/description/ 题目: There is an m by n grid with a ball. Given the start coordinate (i,j) of
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/is-subsequence/description/ 题目: Given a string s and a string t, check if s is subsequence of t. You may assume
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/can-i-win/description/ 题目: In the "100 game," two players take turns adding, to a running total, any integer fro
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/maximum-length-of-pair-chain/description/ 题目: You are given n pairs of numbers. In every pair, the first number
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/unique-substrings-in-wraparound-string/description/ 题目: Consider the string s to be the infinite wraparound stri
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/continuous-subarray-sum/description/ 题目: Given a list of non-negative numbers and a target integer k, write a fu
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/4-keys-keyboard/description/ 题目: Imagine you have a special keyboard with the following keys: Key 1: (A): Print
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/2-keys-keyboard/description/ 题目: Initially on a notepad only one character 'A' is present. You can perform two o
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/output-contest-matches/description/ 题目: During the NBA playoffs, we always arrange the rather strong team to pla
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/queue-reconstruction-by-height/description/ 题目: Suppose you have a random list of people standing in a queue. Ea
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/find-bottom-left-tree-value/description/ 题目: Given a binary tree, find the leftmost value in the last row of the
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/maximum-binary-tree/description/ 题目: Given an integer array with no duplicates. A maximum tree building on this
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/valid-palindrome-ii/description/ 题目: Given a non-empty string s, you may delete at most one character. Judge whe
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/shortest-unsorted-continuous-subarray/ 题目: Given an integer array, you need to find one continuous subarray that
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/non-decreasing-array/description/ 题目: Given an array with n integers, your task is to check if it could become n
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/design-compressed-string-iterator/description/ 题目: Design and implement a data structure for a compressed string
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/largest-palindrome-product/description/ 题目: Find the largest palindrome made from the product of two n-digit num
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/can-place-flowers/ 题目: Suppose you have a long flowerbed in which some of the plots are planted and some are not
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/sum-of-square-numbers/description/ 题目: Given a non-negative integer c, your task is to decide whether there're t
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/maximum-average-subarray-i/description/ 题目: Given an array consisting of n integers, find the contiguous subarra
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/number-of-longest-increasing-subsequence/description/ 题目: Given an unsorted array of integers, find the number o
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-continuous-increasing-subsequence/ 题目: Given an unsorted array of integers, find the length of longest c
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/second-minimum-node-in-a-binary-tree/ 题目: Given a non-empty special binary tree consisting of nodes with the non
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/longest-harmonious-subsequence/description/ 题目: We define a harmonious array is an array where the difference be
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/set-mismatch/description/ 题目: The set S originally contains numbers from 1 to n. But unfortunately, due to the d
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/student-attendance-record-i/description/ 题目: You are given a string representing an attendance record for a stud
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/image-smoother/description/ 题目: Given a 2D integer matrix M representing the gray scale of an image, you need to
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/range-addition-ii/description/ 题目: Given an m * n matrix M initialized with all 0's and several update operation
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/range-addition/description/ 题目: Assume you have an array of length n initialized with all 0's and are given k up
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/minimum-index-sum-of-two-lists/description/ 题目: Suppose Andy and Doris want to choose a restaurant for dinner, a
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/binary-tree-tilt/description/ 题目: Given a binary tree, return the tilt of the whole tree. The tilt of a tree nod
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/maximum-product-of-three-numbers/ 题目: Given an integer array, find three numbers whose product is maximum and ou
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/convert-bst-to-greater-tree/description/ 题目: Given a Binary Search Tree (BST), convert it to a Greater Tree such
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/trim-a-binary-search-tree/ 题目: Given a binary search tree and the lowest and highest boundaries as L and R, trim
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/judge-route-circle/description/ 题目: Initially, there is a Robot at position (0, 0). Given a sequence of its move
阅读全文
摘要:Java String.split() method 有如下几种特殊情况: 1. 分隔符出现在首尾 结果是: 首部的分隔符革出一个空位,尾部分隔符没有革出空位. 这里的空位不是空格.参看3 和 4. 2. 结果: 如果中间没有革出值,那么所有值都清空. 3. 结果: 若是首尾出现空格,那么会被单独革
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/two-sum-iv-input-is-a-bst/description/ 题目: Given a Binary Search Tree and a target number, return true if there
阅读全文
摘要:原题链接在这里:https://leetcode.com/problems/average-of-levels-in-binary-tree/discuss/ 题目: Given a non-empty binary tree, return the average value of the nod
阅读全文