leetcode
dike1993
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
算法:LeetCode240
题目Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted in ascending from left to right. Integers i原创 2017-03-05 10:18:06 · 379 阅读 · 0 评论 -
leetcode 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 A H N A P L原创 2017-06-24 10:44:11 · 269 阅读 · 0 评论 -
leetcode 3. Longest Substring Without Repeating Characters
题目 Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the length is 3. Given "bbbbb", the answer is "b"原创 2017-06-23 11:41:34 · 277 阅读 · 0 评论 -
leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal
1.题目 Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree 2.思路 递归.每次从后续遍历最后得到root,然后根据前序分割left tree和right tr原创 2017-06-03 11:46:40 · 213 阅读 · 0 评论 -
leetcode 96. Unique Binary Search Trees
1.题目 Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 unique BST's. 1 3 3 2 1原创 2017-06-03 10:26:27 · 211 阅读 · 0 评论 -
leetcode 151. Reverse Words in a String
1.题目 Given an input string, reverse the string word by word. For example, Given s = "the sky is blue", return "blue is sky the". 2.思路 可以考虑先对整个字符串反转,然后对其中的每个word反转,或者倒过来,先对每个word反转,然后对整个字符串反转原创 2017-06-01 13:48:11 · 268 阅读 · 0 评论 -
leetcode583. Delete Operation for Two Strings
题目 Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one character in either string. Example 1: Inp原创 2017-05-21 13:17:03 · 423 阅读 · 0 评论 -
leetcode 522. Longest Uncommon Subsequence II
一。题目 Given a list of strings, you need to find the longest uncommon subsequence among them. The longest uncommon subsequence is defined as the longest subsequence of one of these strings and this s原创 2017-06-01 13:12:50 · 705 阅读 · 0 评论 -
leetcode 17. Letter Combinations of a Phone Number
1.题目 Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digi原创 2017-05-27 21:21:33 · 189 阅读 · 0 评论 -
leetcode55. Jump Game
题目Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if you a原创 2017-05-08 17:55:55 · 226 阅读 · 0 评论 -
leetcode516. Longest Palindromic Subsequence
题目Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000.Example 1: Input:“bbbab”Output:4One possible longest palindromic subsequ原创 2017-04-24 20:00:32 · 467 阅读 · 0 评论 -
leetcode392. Is Subsequence
题目Given a string s and a string t, check if s is subsequence of t.You may assume that there is only lower case English letters in both s and t. t is potentially a very long (length ~= 500,000) string,原创 2017-05-15 13:28:35 · 221 阅读 · 0 评论 -
leetcode322. Coin Change
题目You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you need to make up that amount. If that amount of money原创 2017-04-15 17:03:07 · 218 阅读 · 0 评论 -
算法:LeetCode5. Longest Palindromic Substring
题目Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example: Input: "babad" Output: "bab" Note: “aba” is also a valid answer.Ex原创 2017-04-02 16:57:15 · 357 阅读 · 0 评论 -
算法:402. Remove K Digits
题目Given 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 10002 and will be ≥ k. Th原创 2017-03-25 12:05:48 · 318 阅读 · 0 评论 -
leetcode523. Continuous Subarray Sum
题目Given a list of non-negative numbers and a target integer k, write a function to check if the array has a continuous subarray of size at least 2 that sums up to the multiple of k, that is, sums up to原创 2017-04-09 11:46:38 · 298 阅读 · 0 评论 -
算法:LeetCode207 Course Schedule
题目There are a total of n courses you have to take, labeled from 0 to n - 1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pai原创 2017-03-19 23:57:46 · 316 阅读 · 0 评论 -
算法:LeetCode215
题目215 . Kth Largest Element in an ArrayFind the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example, Given [原创 2017-02-26 20:36:52 · 359 阅读 · 0 评论 -
leetcode8. 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 what are the possible inpu原创 2017-06-25 11:49:29 · 345 阅读 · 0 评论
分享