![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 57
JacobGo
一只热爱健身的程序猿。
展开
-
[leetcode]Remove Duplicates from Sorted Array(Java实现)
本题为leetcode题库28:Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must原创 2017-05-23 19:33:01 · 548 阅读 · 0 评论 -
[leetcode]Remove Duplicates from Sorted Array II(Java实现)
牛客网测试地址:https://www.nowcoder.com/questionTerminal/567f420f12ed4069b7e1d1520719d409leetcode地址:https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/#/description题目:80. Remove D原创 2017-05-25 21:41:02 · 479 阅读 · 0 评论 -
leetcode:1. Two Sum(Java实现)
leetcode测试地址:https://leetcode.com/problems/two-sum/#/description1. Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may原创 2017-06-17 10:23:23 · 640 阅读 · 0 评论 -
leetcode:4. Median of Two Sorted Arrays(Java实现)
leetcode测试地址:https://leetcode.com/problems/median-of-two-sorted-arrays/#/descriptionThere are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted原创 2017-06-17 11:48:06 · 475 阅读 · 0 评论 -
[leetcode]11. Container With Most Water(Java实现)
leetcode:https://leetcode.com/problems/container-with-most-water/#/solutionsGiven n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lin原创 2017-06-18 10:34:23 · 419 阅读 · 0 评论 -
[leetcode]15. 3Sum(Java实现)
https://leetcode.com/problems/3sum/#/descriptionGiven an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives原创 2017-06-18 11:12:49 · 577 阅读 · 0 评论 -
[leetcode]16.3Sum Closest(Java实现)
https://leetcode.com/problems/3sum-closest/#/descriptionGiven an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of原创 2017-06-18 14:58:16 · 415 阅读 · 0 评论 -
[leetcode]18.4Sum(Java实现)
leetcode地址:https://leetcode.com/problems/4sum/#/descriptionGiven an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadrupl原创 2017-06-19 09:37:42 · 344 阅读 · 0 评论 -
[leetcode]27.Remove Element(Java)
测试地址:https://leetcode.com/problems/remove-element/#/descriptionGiven an array and a value, remove all instances of that value in place and return the new length.Do not allocate ext原创 2017-06-19 10:08:08 · 510 阅读 · 0 评论 -
[leetcode]74. Search a 2D Matrix(Java)
https://leetcode.com/problems/search-a-2d-matrix/#/descriptionWrite an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Inte原创 2017-06-29 10:44:59 · 480 阅读 · 0 评论 -
[leetcode]75. Sort Colors(Java)
https://leetcode.com/problems/sort-colors/#/descriptionGiven an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in原创 2017-06-29 10:55:52 · 531 阅读 · 0 评论 -
[leetcode]78. Subsets(Java)
https://leetcode.com/problems/subsets/#/descriptionGiven a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For exa原创 2017-06-29 11:50:45 · 1068 阅读 · 0 评论 -
[leetcode]31.Next Permutation(Java实现)
测试地址:https://leetcode.com/problems/next-permutation/#/descriptionImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such a原创 2017-06-20 09:49:29 · 471 阅读 · 0 评论 -
[leetcode]33. Search in Rotated Sorted Array(Java实现)
测试地址:https://leetcode.com/problems/search-in-rotated-sorted-array/#/descriptionSuppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2原创 2017-06-20 10:51:14 · 535 阅读 · 0 评论 -
[leetcode]34. Search for a Range(Java实现)
leetcode测试地址:https://leetcode.com/problems/search-for-a-range/#/descriptionGiven an array of integers sorted in ascending order, find the starting and ending position of a given target value原创 2017-06-21 09:30:28 · 741 阅读 · 0 评论 -
[leetcode]79. Word Search(Java)
https://leetcode.com/problems/word-search/#/descriptionGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacen原创 2017-06-30 12:27:53 · 821 阅读 · 0 评论 -
[leetcode]35. Search Insert Position(Java)
leetcode:https://leetcode.com/problems/search-insert-position/#/descriptionGiven a sorted array and a target value, return the index if the target is found. If not, return the index where it原创 2017-06-21 09:55:56 · 433 阅读 · 0 评论 -
[leetcode]39. Combination Sum(Java)
leetcode:https://leetcode.com/problems/combination-sum/#/descriptionGiven a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where t原创 2017-06-21 10:37:33 · 1553 阅读 · 0 评论 -
[leetcode]40. Combination Sum II(Java)
leetcode:https://leetcode.com/problems/combination-sum-ii/#/descriptionGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidat原创 2017-06-21 11:06:36 · 642 阅读 · 0 评论 -
[leetcode]41. First Missing Positive(Java)
leetcode:https://leetcode.com/problems/first-missing-positive/#/descriptionGiven an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,原创 2017-06-22 12:22:06 · 587 阅读 · 0 评论 -
[leetcode]81. Search in Rotated Sorted Array II(Java)
https://leetcode.com/problems/search-in-rotated-sorted-array-ii/#/descriptionFollow up for "Search in Rotated Sorted Array":What if duplicates are allowed?Would this affect the run-tim原创 2017-07-02 10:41:17 · 400 阅读 · 0 评论 -
[leetcode]84. Largest Rectangle in Histogram(Java)
https://leetcode.com/problems/largest-rectangle-in-histogram/#/descriptionGiven n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the a原创 2017-07-02 13:53:54 · 1978 阅读 · 1 评论 -
[leetcode]96. Unique Binary Search Trees(Java)
https://leetcode.com/problems/unique-binary-search-trees/#/descriptionGiven n, how many structurally unique BST's (binary search trees) that store values 1...n?For example,Given n =原创 2017-07-12 10:20:27 · 478 阅读 · 0 评论 -
[leetcode]42. Trapping Rain Water(Java)
https://leetcode.com/problems/trapping-rain-water/#/descriptionGiven n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is ab原创 2017-06-23 10:53:59 · 674 阅读 · 0 评论 -
[leetcode]85. Maximal Rectangle(Java)
https://leetcode.com/problems/maximal-rectangle/#/descriptionGiven a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.For ex原创 2017-07-03 09:32:09 · 602 阅读 · 0 评论 -
[leetcode]88. Merge Sorted Array(Java)
https://leetcode.com/problems/merge-sorted-array/#/descriptionGiven two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1原创 2017-07-03 10:26:45 · 415 阅读 · 0 评论 -
[leetcode]90. Subsets II(Java)
https://leetcode.com/problems/subsets-ii/#/descriptionGiven a collection of integers that might contain duplicates, nums, return all possible subsets.Note: The solution set must not cont原创 2017-07-03 10:50:58 · 485 阅读 · 0 评论 -
[leetcode]66. Plus One(Java)
https://leetcode.com/problems/plus-one/#/descriptionGiven a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not c原创 2017-06-23 12:35:44 · 519 阅读 · 0 评论 -
[leetcode]95. Unique Binary Search Trees II(Java)
https://leetcode.com/problems/unique-binary-search-trees-ii/#/descriptionGiven an integer n, generate all structurally unique BST's (binary search trees) that store values 1...n.For exam原创 2017-07-12 20:16:51 · 575 阅读 · 0 评论 -
[leetcode]97. Interleaving String(Java)
https://leetcode.com/problems/interleaving-string/#/descriptionGiven s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbb原创 2017-07-13 10:15:54 · 458 阅读 · 0 评论 -
[leetcode]115. Distinct Subsequences(Java)
https://leetcode.com/problems/distinct-subsequences/#/descriptionGiven a string S and a string T, count the number of distinct subsequences of S which equals T.A subsequence of a strin原创 2017-07-13 11:19:42 · 475 阅读 · 0 评论 -
[leetcode]45. Jump Game II(Java)
https://leetcode.com/problems/jump-game-ii/#/descriptionGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array原创 2017-06-25 10:54:32 · 595 阅读 · 0 评论 -
[leetcode]48. Rotate Image(Java)
https://leetcode.com/problems/rotate-image/#/descriptionYou are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-p原创 2017-06-25 11:31:16 · 398 阅读 · 0 评论 -
[leetcode]3. Longest Substring Without Repeating Characters(Java)
https://leetcode.com/problems/longest-substring-without-repeating-characters/#/descriptionGiven a string, find the length of the longest substring without repeating characters.Examples原创 2017-07-05 10:07:06 · 481 阅读 · 0 评论 -
[leetcode]54. Spiral Matrix(Java)
https://leetcode.com/problems/spiral-matrix/#/descriptionGiven a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the原创 2017-06-26 10:26:08 · 440 阅读 · 0 评论 -
[leetcode]55. Jump Game(Java)
https://leetcode.com/problems/jump-game/#/descriptionGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array repre原创 2017-06-26 10:55:30 · 752 阅读 · 0 评论 -
[leetcode]56. Merge Intervals(Java)
https://leetcode.com/problems/merge-intervals/#/descriptionGiven a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],原创 2017-06-26 12:42:25 · 779 阅读 · 0 评论 -
[leetcode]5. Longest Palindromic Substring(Java)
https://leetcode.com/problems/longest-palindromic-substring/#/solutionsGiven a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.原创 2017-07-05 10:45:07 · 282 阅读 · 0 评论 -
[leetcode]6. ZigZag Conversion(Java)
https://leetcode.com/problems/zigzag-conversion/#/descriptionThe string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this原创 2017-07-05 11:07:20 · 454 阅读 · 0 评论 -
[leetcode]120. Triangle(Java)
https://leetcode.com/problems/triangle/#/descriptionGiven a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For exampl原创 2017-07-14 13:21:24 · 653 阅读 · 0 评论