### LeetCode Solutions In Java

LeetCode刷题之路。

4 已关注
122篇博文
• #### 22. Generate Parentheses（生成括号）

Given n pairs of parentheses, write a function to generate all combinations of well-formed parenthes...

2017-09-21 20:39
691
• #### 18. 4Sum（求数组中和为指定值的4个数）

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = tar...

2017-09-20 22:27
830
• #### 16. 3Sum Closest（找出和最接近给定值的三个数）

Given an array S of n integers, find three integers in S such that the sum is closest to a given num...

2017-09-18 19:55
564
• #### 17. Letter Combinations of a Phone Number（根据手机按键求字母的组合）

Given a digit string, return all possible letter combinations that the number could represent.A mapp...

2017-09-19 11:48
832
• #### 15. 3Sum（求数组中和为0的3个数）

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all un...

2017-09-13 20:27
869
• #### 11. Container With Most Water（求能装最多水的容器）

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). ...

2017-09-08 10:27
927
• #### 5. Longest Palindromic Substring（求最长回文子字符串）

Given a string s, find the longest palindromic substring in s. You may assume that the maximum lengt...

2017-09-05 19:40
486
• #### 3. Longest Substring Without Repeating Characters（计算不含重复字符的最长子串的长度）

Given a string, find the length of the longest substring without repeating characters. Examples: ...

2017-09-05 18:02
531
• #### 2. Add Two Numbers （两数求和）

You are given two non-empty linked lists representing two non-negative integers. The digits are stor...

2017-07-13 00:30
365
• #### 463. Island Perimeter（计算岛的周长）

You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represen...

2017-03-28 16:31
553
• #### 476. Number Complement（求补数）

Given a positive integer, output its complement number. The complement strategy is to flip the bits ...

2017-03-12 20:59
590
• #### 500. Keyboard Row（判断单词能否由键盘上的某一行字符表示）

Given a List of words, return the words that can be typed using letters of alphabet on only one row'...

2017-03-12 21:24
592
• #### 496. Next Greater Element I（寻找下一个较大的数）

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of...

2017-03-13 12:22
515
• #### 436. Find Right Interval （寻找最近的右区间）

Given a set of intervals, for each of the interval i, check if there exists an interval j whose star...

2016-12-03 23:33
627
• #### 13. Roman to Integer （整数转罗马数字）

Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from ...

2016-12-01 09:45
476
• #### 144. Binary Tree Preorder Traversal （二叉树的先序遍历）

Given a binary tree, return the preorder traversal of its nodes' values. For example: Given bina...

2016-11-30 16:53
470
• #### 378. Kth Smallest Element in a Sorted Matrix（查找矩阵中第k小的数）

Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth ...

2016-11-30 16:22
396
• #### 268. Missing Number（查找遗漏的数）

Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is miss...

2016-11-29 21:14
402
• #### 94. Binary Tree Inorder Traversal（中序遍历二叉树）

Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary t...

2016-11-29 20:57
371
• #### 392. Is Subsequence （子序列判断）

Given a string s and a string t, check if s is subsequence of t. You may assume that there is onl...

2016-11-29 10:53
820