- 博客(21)
- 资源 (3)
- 收藏
- 关注
原创 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 135
原创 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 168
原创 76. Minimum Window Substring
LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi52076. Minimum Window SubstringDescriptionHintsSubmissionsDiscussSolutionGiven a string S and a ...
2018-09-25 21:09:15 240
原创 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 124
原创 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 163
原创 62. Unique Paths
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 874 6762. Unique PathsDescripti...
2018-09-19 23:23:12 134
原创 61. Rotate List
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi52061. Rotate ListDescriptionHintsSu...
2018-09-18 20:30:17 122
原创 60. Permutation Sequence
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi52060. Permutation SequenceDescripti...
2018-09-17 20:26:34 134
原创 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 107
原创 56. Merge Intervals
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 1133 9256. Merge IntervalsDescr...
2018-09-13 21:03:36 133
原创 55. Jump Game
使用 领扣中国,来获得适合您的内容以及最佳的用户体验。即刻前往 | 将我的账号同步到 LeetCode 中国LeetCodeExploreProblemsMock ContestArticlesDiscuss Store PremiumNew Playgroundlifeqiuzhi520 1015 13555. Jump GameDescriptio...
2018-09-13 20:19:23 110
原创 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 118
原创 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 106
原创 自己写的一个简单的加法解释器
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 489
原创 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 121
原创 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 139
原创 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 98
原创 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 93
原创 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 103
原创 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 156
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人