
LeetCode
develbai
所有时间管理的背后,是良好的习惯,而良好习惯养成的背后,是惊人的意志力
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode 34. Search for a Range
LeetCode 34. Search for a RangeDescriptionGiven an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be原创 2017-12-05 22:32:38 · 164 阅读 · 0 评论 -
LeetCode 344. Reverse String
LeetCode 344. Reverse String Description Write a function that takes a string as input and returns the string reversed. Example: Given s = “hello”, return “olleh”. class Solution {原创 2018-01-17 22:09:28 · 165 阅读 · 0 评论 -
LeetCode 345. Reverse Vowels of a String
LeetCode 345. Reverse Vowels of a String Description Write a function that takes a string as input and reverse only the vowels of a string. Example 1: Given s = “hello”, return “holle”. Exa原创 2018-01-17 22:10:49 · 157 阅读 · 0 评论 -
LeetCode 11. Container With Most Water
LeetCode 11. Container With Most Water Description Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two en原创 2018-01-18 22:03:01 · 171 阅读 · 0 评论 -
LeetCode 20. Valid Parentheses
LeetCode 20. Valid Parentheses Description Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the co原创 2018-01-19 22:04:10 · 161 阅读 · 0 评论 -
LeetCode 9. Palindrome Number
LeetCode 9. Palindrome Number Description Determine whether an integer is a palindrome. Do this without extra space. class Solution { public boolean isPalindrome(int x) {原创 2018-01-19 22:04:57 · 175 阅读 · 0 评论 -
LeetCode 438. Find All Anagrams in a String
LeetCode 438. Find All Anagrams in a String Description Given a string s and a non-empty string p, find all the start indices of p’s anagrams in s. Strings consists of lowercase English letters o原创 2018-01-20 21:41:43 · 195 阅读 · 0 评论 -
LeetCode 387. First Unique Character in a String
387. First Unique Character in a String Description Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1. Examples: s = “leetcode”...原创 2018-03-01 21:55:30 · 281 阅读 · 1 评论 -
LeetCode 434. Number of Segments in a String
434. Number of Segments in a String Description Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the stri...原创 2018-03-01 21:56:15 · 303 阅读 · 0 评论 -
LeetCode 125. Valid Palindrome
LeetCode 125. Valid Palindrome Description Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring other cases. For example, “A man, a plan, a cana原创 2018-01-17 22:08:35 · 180 阅读 · 0 评论 -
LeetCode 167. Two Sum II - Input array is sorted
LeetCode 167. Two Sum II - Input array is sorted Description Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target numbe原创 2018-01-17 22:07:10 · 161 阅读 · 0 评论 -
LeetCode 215. Kth Largest Element in an Array
LeetCode 215. Kth Largest Element in an Array Description Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct eleme原创 2018-01-16 21:58:43 · 632 阅读 · 0 评论 -
LeetCode 728. Self Dividing Numbers
LeetCode 728. Self Dividing NumbersDescriptionA self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 ==原创 2017-12-06 21:21:26 · 228 阅读 · 0 评论 -
LeetCode 27. Remove Element
LeetCode 27. Remove ElementDescriptionGiven an array and a value, remove all instances of that value in-place and return the new length.Do not allocate extra space for another array, you must do this b原创 2017-12-06 21:25:16 · 226 阅读 · 1 评论 -
LeetCode 209. Minimum Size Subarray Sum
LeetCode 209. Minimum Size Subarray Sum Description Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there原创 2018-01-21 22:30:14 · 222 阅读 · 0 评论 -
LeetCode 76. Minimum Window Substring
76. Minimum Window Substring Description Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). For example, S = “ADOBECODEB原创 2018-01-21 22:31:20 · 232 阅读 · 0 评论 -
LeetCode 3. Longest Substring Without Repeating Characters
leetCode 3. Longest Substring Without Repeating Characters Description Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb”, the an原创 2018-01-20 21:40:49 · 181 阅读 · 0 评论 -
LeetCode 80. Remove Duplicates from Sorted Array II
LeetCode 80. Remove Duplicates from Sorted Array II Description Follow up for “Remove Duplicates”: What if duplicates are allowed at most twice? For example, Given sorted array nums = [1,1,1,2,原创 2018-01-16 21:53:03 · 162 阅读 · 0 评论 -
LeetCode 75. Sort Colors
LeetCode 75. Sort Colors Description Given 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 the order red, white and原创 2018-01-16 21:56:25 · 208 阅读 · 0 评论 -
LeetCode 88. Merge Sorted Array
LeetCode 88. Merge Sorted Array Description Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size原创 2018-01-16 21:57:52 · 238 阅读 · 0 评论 -
LeetCode 56. Merge Intervals
56. Merge Intervals Description Given a collection of intervals, merge all overlapping intervals. For example, Given [1,3],[2,6],[8,10],[15,18], return [1,6],[8,10],[15,18]. class Soluti...原创 2018-03-01 21:57:10 · 303 阅读 · 0 评论