![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Leetcode
熊仙森
Walk slowly, it can always be far away
展开
-
LeetCode 001 Two Sum
Two SumGiven an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use th...原创 2019-02-03 17:59:33 · 196 阅读 · 2 评论 -
LeetCode 022 Generate Parentheses
Generate ParenthesesGiven n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution set is:[ "((()))", "(()())", "...原创 2019-06-29 22:02:46 · 147 阅读 · 0 评论 -
402.Remove K Digits(删去k个数字后的最小值)精解
题目:Remove K DigitsGiven a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.Note:The length of num is less than 1000...原创 2018-11-12 22:37:15 · 416 阅读 · 0 评论 -
LeetCoe 016 3Sum Closest
3Sum ClosestGiven an array nums of n integers and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each...原创 2019-06-04 16:26:18 · 132 阅读 · 0 评论 -
LeetCode 015 3Sum
3SumMediumGiven an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:The solution set mus...原创 2019-06-04 16:17:51 · 134 阅读 · 0 评论 -
LeetCode 021 Merge Two Sorted Lists
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.Example:Input: 1->2->4, 1-&...原创 2019-06-19 16:59:05 · 202 阅读 · 2 评论 -
LeetCode 020 Valid Parentheses
Valid ParenthesesGiven a string containing just the characters ‘(’, ‘)’, ‘{’, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.An input string is valid if:Open brackets must be closed by t...原创 2019-06-19 12:08:47 · 178 阅读 · 0 评论 -
LeetCode 018 4Sum
4SumGiven an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum o...原创 2019-06-19 10:08:11 · 166 阅读 · 0 评论 -
LeetCode 011 Container With Most Water
Container With Most WaterGiven 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 endpoints of line i is at (i, ...原创 2019-05-29 22:10:54 · 163 阅读 · 2 评论 -
LeetCode 017 Letter Combinations of a Phone Number
Letter Combinations of a Phone NumberGiven a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent.A mapping of digit to letters (just ...原创 2019-06-13 17:20:49 · 121 阅读 · 0 评论 -
LeetCode 019 Remove Nth Node From End of List
Remove Nth Node From End of ListGiven a linked list, remove the n-th node from the end of list and return its head.Example:Given linked list: 1->2->3->4->5, and n = 2.After removing ...原创 2019-06-05 20:00:17 · 157 阅读 · 0 评论 -
LeetCode 012 Integer to Roman
Integer to RomanRoman numerals are represented by seven different symbols: I, V, X, L, C, D and M.SymbolValueI1V5X10L50C100D500M1000For example, two is written ...原创 2019-05-31 11:11:03 · 147 阅读 · 0 评论 -
LeetCode 008 String to Integer (atoi)
String to Integer (atoi)Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whitespace character is found....原创 2019-03-05 22:04:18 · 163 阅读 · 0 评论 -
LeetCode 007 Reverse Integer
Reverse IntegerGiven a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume w...原创 2019-02-25 22:07:53 · 146 阅读 · 0 评论 -
LeetCode 009 Palindrome Number
Palindrome NumberDetermine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input: -121Outp...原创 2019-03-04 21:57:36 · 152 阅读 · 0 评论 -
LeetCode 003 Longest Substring Without Repeating Characters
Longest Substring Without Repeating CharactersGiven a string, find the length of the longest substring without repeating characters.Example 1:Input: “abcabcbb”Output: 3Explanation: The answer is...原创 2019-02-18 20:41:50 · 125 阅读 · 0 评论 -
Leetcode 002 Add Two Numbers
Add Two NumbersYou are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numb...原创 2019-02-17 21:45:33 · 221 阅读 · 0 评论 -
LeetCode 023 Merge k Sorted Lists
Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Example:Input:[ 1->4->5, 1->3->4, 2->6]Output: 1->1...原创 2019-06-30 21:00:19 · 161 阅读 · 0 评论