![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 64
jnuyanfa
这个作者很懒,什么都没留下…
展开
-
leetcode 031 Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possibl原创 2016-04-26 20:40:29 · 267 阅读 · 0 评论 -
leetcode016 3Sum Closest
题目16. 3Sum Closest Given 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 the three integers. You may assume that each input原创 2016-03-29 01:22:21 · 342 阅读 · 0 评论 -
leetcode015 3Sum
题目15. 3 Sum Given 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 the sum of zero. Note: - Elements in a triplet原创 2016-03-24 00:22:07 · 314 阅读 · 0 评论 -
leetcode014 Longest Common Prefix
14. Longest Common Prefix Write a function to find the longest common prefix string amongst an array of strings.原创 2016-03-22 23:49:10 · 312 阅读 · 0 评论 -
leetcode013 Roman to Integer
题目13. Roman to Integer Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.原创 2016-03-21 22:00:49 · 240 阅读 · 0 评论 -
leetcode012 Integer to Roman
12. Integer to Roman Given an integer, convert it to a roman numeral.原创 2016-03-20 23:03:27 · 248 阅读 · 0 评论 -
leetcode011 Container With Most Water
题目11. Container With Most Water 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 endpoints of line i is at原创 2016-03-20 01:18:08 · 290 阅读 · 0 评论 -
leetcode009 Palindrome Number
题目9. Palindrome Number Determine whether an integer is a palindrome. Do this without extra space.原创 2016-03-17 01:14:14 · 252 阅读 · 0 评论 -
leetcode008 String to Integer (atoi)
题目8. String to Integer (atoi) Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself wh原创 2016-03-16 00:12:36 · 293 阅读 · 0 评论 -
leetcode007 Reverse Integer
题目7. Reverse Integer Reverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321原创 2016-03-14 23:43:48 · 277 阅读 · 0 评论 -
leetcode006 ZigZag Conversion
题目6. ZigZag Conversion The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P原创 2016-03-14 13:33:33 · 303 阅读 · 0 评论 -
leetcode005 Longest Palindromic Substring
题目 5. Longest Palindromic SubstringGiven a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic su原创 2016-03-14 00:30:53 · 290 阅读 · 0 评论 -
leetcode004 Median of Two Sorted Arrays
题目4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+原创 2016-03-14 00:29:39 · 363 阅读 · 0 评论 -
leetcode003 Longest Substring Without Repeating Characters
题目3. Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters原创 2016-03-14 00:28:43 · 339 阅读 · 0 评论 -
leetcode002 Add Two Numbers
题目2. Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers an原创 2016-03-14 00:27:11 · 326 阅读 · 0 评论 -
leetcode001 TwoSum
题目1. Two Sum Given 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.Example:Given num原创 2016-03-14 00:25:39 · 321 阅读 · 0 评论 -
leetcode017 Letter Combinations of a Phone Number
Letter Combinations of a Phone Number Given a digit string, return all possible letter combinations that the number could represent.原创 2016-03-30 23:43:30 · 282 阅读 · 0 评论 -
leetcode018 Four Sum
题目18. 4 Sum Given 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 quadruplets in the array which gives the sum of target. Note: - E原创 2016-03-31 22:28:45 · 398 阅读 · 0 评论 -
leetcode019 Remove Nth Node From End of List
题目19. Remove Nth Node From End of List Given a linked list, remove the nth node from the end of list and return its head. For example,Given linked list: 1->2->3->4->5, and n = 2.After removing the原创 2016-04-02 00:43:53 · 309 阅读 · 0 评论 -
leetcode 032 Longest Valid Parentheses
Given a string containing just the characters'(' and ')', find the length of the longest valid (well-formed) parentheses substring.原创 2016-04-28 23:53:48 · 322 阅读 · 0 评论 -
leetcode 033 Search in Rotated Sorted Array
Suppose a sorted array is rotated at some pivot unknown to you beforehand.原创 2016-05-02 21:38:30 · 328 阅读 · 0 评论 -
leetcode 034 Search For A Range
题目Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of O(logn)O(\log n). If the target is not f原创 2016-05-03 22:56:21 · 377 阅读 · 0 评论 -
leetcode 035 Search Insert Position
题目Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You may assume no duplicates in the array.原创 2016-05-04 14:11:49 · 369 阅读 · 0 评论 -
leetcode 036 Valid Sudoku
Determine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules. The Sudoku board could be partially filled, where empty cells are filled with the character '.'.原创 2016-05-06 20:25:13 · 727 阅读 · 0 评论 -
leetcode 029 Divide Two Integers
Divide two integers without using multiplication, division and mod operator. If it is overflow, return MAX_INT.原创 2016-04-23 22:19:15 · 415 阅读 · 0 评论 -
leetcode 28 Implement strStr()
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.原创 2016-04-15 21:59:12 · 341 阅读 · 0 评论 -
leetcode 27 Romove Element
27. Romove Element Given an array and a value, remove all instances of that value in place and return the new length.原创 2016-04-14 22:09:33 · 289 阅读 · 0 评论 -
leetcode 26 Remove Duplicates from Sorted Array
Remove Duplicates from Sorted Array Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.原创 2016-04-13 23:05:11 · 227 阅读 · 0 评论 -
leetcode 25 Reverse Nodes in k-Group
25. Reverse Nodes in k-Group Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.原创 2016-04-13 01:15:21 · 271 阅读 · 0 评论 -
leetcode 24 Swap Nodes in Pairs
题目24. Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should us原创 2016-04-11 22:46:44 · 258 阅读 · 0 评论 -
leetcode 23 Merge k Sorted Lists
23. Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.原创 2016-04-11 00:39:50 · 282 阅读 · 0 评论 -
leetcode 022 Generate Parentheses
Generate Parentheses Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.原创 2016-04-08 00:48:18 · 332 阅读 · 0 评论 -
leetcode 021 Merge Two Sorted Lists
Merge Two Sorted Lists Merge 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.原创 2016-04-06 00:33:18 · 281 阅读 · 0 评论 -
leetcode020 Valid Parentheses
Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.原创 2016-04-04 21:27:11 · 350 阅读 · 0 评论 -
leetcode 038 Count and Say
The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, …原创 2016-05-19 22:11:27 · 525 阅读 · 0 评论