- 博客(171)
- 资源 (3)
- 收藏
- 关注
原创 209. Minimum Size Subarray Sum
Explore Problems Mock Contest Articles Discuss Store Premium 743 48 209. Minimum Size Subarray SumDescriptionHintsSubmissionsDiscussSolutionPick OneGiven an array o...
2018-10-13 12:14:17
287
原创 95. Unique Binary Search Trees II
LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 752 7595. Unique Binary Search Trees IIDescriptionHintsSubmissionsDiscussSolutionPick OneG...
2018-10-03 18:35:31
400
原创 89. Gray Code
class Solution { public List<Integer> grayCode(int n) { List<Integer> list = new ArrayList<Integer>(); for(int i = 0;i <1<<n;i++){ ...
2018-10-02 20:36:29
131
原创 87. Scramble String
LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 180 29787. Scramble StringDescriptionHintsSubmissionsDiscussSolutionYou have no submission ...
2018-10-02 15:50:28
270
原创 86. Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each of ...
2018-10-02 14:43:25
176
原创 Partition List
/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */class Solution { public ListNode partition(...
2018-10-02 14:32:42
137
原创 85. Maximal Rectangle
LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 833 2785. Maximal RectangleDescriptionHintsSubmissionsDiscussSolutionPick OneGiven a 2D bi...
2018-10-02 13:57:33
171
原创 84. Largest Rectangle in Histogram
LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 1206 3184. Largest Rectangle in HistogramDescriptionHintsSubmissionsDiscussSolutionPick One...
2018-10-02 11:47:59
185
原创 8. Subsets
Given a set of distinct integers, nums, return all possible subsets (the power set).Note: The solution set must not contain dclass Solution { public List<List<Integer>> subsets(i...
2018-09-27 21:29:04
144
原创 77. Combinations DescriptionHintsSubmissionsDiscussSolution Given two integers n and k, return all p
public static List<List<Integer>> combine(int n, int k) { List<List<Integer>> combs = new ArrayList<List<Integer>>(); combine(combs, new ArrayList<Integer&
2018-09-27 20:46:11
179
原创 76. Minimum Window Substring
LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi52076. Minimum Window SubstringDescriptionHintsSubmissionsDiscussSolutionGiven a string S and a ...
2018-09-25 21:09:15
246
原创 66. Plus One
Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list, and each elemen...
2018-09-21 08:47:31
135
原创 65. Valid Number
Validate if a given string can be interpreted as a decimal number.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true" -90e3
2018-09-20 19:09:03
166
原创 62. Unique Paths
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 874 6762. Unique PathsDescripti...
2018-09-19 23:23:12
159
原创 61. Rotate List
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi52061. Rotate ListDescriptionHintsSu...
2018-09-18 20:30:17
131
原创 60. Permutation Sequence
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi52060. Permutation SequenceDescripti...
2018-09-17 20:26:34
144
原创 57. Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.Examp...
2018-09-16 19:54:51
126
原创 56. Merge Intervals
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 1133 9256. Merge IntervalsDescr...
2018-09-13 21:03:36
142
原创 55. Jump Game
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 1015 13555. Jump GameDescriptio...
2018-09-13 20:19:23
139
原创 54. Spiral Matrix
Given a matrix of m x n elements (m rowExample 1:Input:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Output: [1,2,3,6,9,8,7,4,5]Example 2:Input:[ [1, 2, 3, 4], [5, 6, 7, 8], [9,10,11,12...
2018-09-10 19:33:35
143
原创 52. N-Queens II
class Solution { int count = 0; public int totalNQueens(int n) { boolean[] cols = new boolean[n]; // columns | boolean[] d1 = new boolean[2 * n]; // diagonals \ boolean[] d2 = new boolean[2 * n]; // d...
2018-09-10 18:22:05
112
原创 自己写的一个简单的加法解释器
package b.a.leetcode;public class Intercepter { private Token currentToken; private int currentPosition; private String currentText; private Token getNextToken() { if (curr...
2018-09-06 22:55:38
499
原创 50. Pow(x, n)
Implement pow(x, n), which calculates x raised to the power n (xn).Example 1:Input: 2.00000, 10Output: 1024.00000Example 2:Input: 2.10000, 3Output: 9.26100Example 3:Input: 2.00000, -2Out...
2018-09-05 21:08:31
131
原创 49. Group Anagrams
Given an array of strings, group anagrams together.Example:Input: ["eat", "tea", "tan", "ate", "nat", "bat"],Output:[ ["ate","eat","tea"], ["nat"
2018-09-05 20:46:19
148
原创 48. Rotate Image
public void rotate(int[][] matrix) { if(matrix == null || matrix.length == 0 || matrix[0].length == 0) return; int rows = matrix.length; int cols = matrix[0].length; for(int first=0, ...
2018-09-04 23:12:50
109
原创 Combination Sum
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.The same repea...
2018-09-03 21:59:31
103
原创 46. Permutations
Given a collection of distinct integers, returnclass Solution { public List<List<Integer>> permute(int[] nums, int index) { if (index == nums.length - 1) { Arr...
2018-09-02 18:40:15
110
原创 45. Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is to...
2018-09-01 20:05:22
168
原创 44. Wildcard Matching
44. Wildcard MatchingDescriptionHintsSubmissionsDiscussSolutionPick OneGiven an input string (s) and a pattern (p), implement wildcard pattern matching with support for '?' and '*'.'?' Matches a...
2018-08-30 22:05:29
184
原创 37. Sudoku Solver
rite a program to solve a Sudoku puzzle by filling the empty cells.A sudoku solution must satisfy all of the following rules:Each of the digits 1-9 must occur exactly once in each row.Each of th...
2018-08-29 19:37:21
124
转载 Search in Rotated Sorted Array
class Solution { public int search(int[] A, int target) { if(A.length ==0) return -1; int lo = 0; int hi = A.length - 1; while (lo < hi) { int mid = (lo + hi) / 2; ...
2018-08-25 15:54:08
121
原创 40. Combination Sum II DescriptionHintsSubmissionsDiscussSolution
40. Combination Sum IIDescriptionHintsSubmissionsDiscussSolutionGiven a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where t...
2018-08-23 19:20:05
105
原创 31. Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible ...
2018-08-21 20:44:00
172
原创 36. Valid Sudoku
36. Valid SudokuDescriptionHintsSubmissionsDiscussSolutionPick OneDetermine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:Each row...
2018-08-17 20:52:56
187
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人