![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode;Problem;Algorithm
文章平均质量分 89
Ooooopsy
这个作者很懒,什么都没留下…
展开
-
LeetCode 34.Search for a Range & 36.Valid Sudoku
Problem 34 Search for a RangeGiven 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 i原创 2017-05-10 19:52:13 · 284 阅读 · 0 评论 -
LeetCode 50.Pow(x, n) & 54.Spiral Matrix
Problem 50 Pow(x, n)Implement pow(x, n).解题思路:1. 题目要求实现 x 的 n 次幂,原理其实很简单,直接n个x连乘即可,但是肯定会超时,所以需要考虑效率更高的算法2. 所考虑用分治的思想来解决问题:pow(x,n) = pow(x,n/2) ^23. 需要考虑n为负数的情况,同时如果直接用pow(x,n/2) * pow(原创 2017-06-13 10:37:02 · 303 阅读 · 0 评论 -
LeetCode 48.Rotate Image & 49.Group Anagrams
Problem 48 Rotate ImageYou 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-place?解题思路:方法1:1. 如果不是直接原创 2017-06-06 18:19:11 · 273 阅读 · 0 评论 -
LeetCode 39.Combination Sum & 40.Combination Sum II
Problem 39 Combination SumGiven a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The sam原创 2017-05-21 15:39:30 · 303 阅读 · 0 评论 -
LeetCode 43.Multiply Strings & 46.Permutations & 47.Permutations II
Problem 43 Multiply StringsGiven two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2.Note:The length of both num1 and num2 is Both num原创 2017-05-28 11:44:49 · 310 阅读 · 0 评论 -
LeetCode 31.Next Permutation & 33.Search in Rotated Sorted Array
Problem 31 Next PermutationImplement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must re原创 2017-05-06 15:45:44 · 310 阅读 · 0 评论 -
LeetCode 494.Target Sum & 516.Longest Palindromic Subsequence
494.Target SumYou are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choose one from + and - as its new原创 2017-04-22 20:52:53 · 232 阅读 · 0 评论 -
LeetCode 22.Generate Parentheses & 24.Swap Nodes in Pairs
Problem 22. 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:[ "((()原创 2017-04-15 14:54:38 · 267 阅读 · 0 评论 -
LeetCode 17.Letter Combinations of a Phone Number & 19.Remove Nth Node From End of List
Problem 17. Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the原创 2017-04-12 23:22:55 · 319 阅读 · 0 评论 -
LeetCode 12.Integer to Roman & 15.3Sum
Problem 12. Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.解题思路:1. 首先要搞清楚罗马数字的拼写原则:罗马数字是阿拉伯数字传入之前使用的一种数码。罗马原创 2017-04-05 16:09:43 · 421 阅读 · 0 评论 -
LeetCode 452. Minimum Number of Arrows to Burst Balloons
贪心算法 greedy原创 2017-03-26 17:24:16 · 240 阅读 · 0 评论 -
LeetCode 399.Evaluate Division & 332.Reconstruct Itinerary
LeetCode Problem332&399 图论 解题思路原创 2017-03-19 20:03:03 · 247 阅读 · 0 评论 -
LeetCode 529.Minesweeper & 515.Find Largest Value in Each Tree Row
LeetCode Problem 529&515 深度搜索 思路小结原创 2017-03-12 15:46:35 · 250 阅读 · 0 评论 -
LeetCode 5.Longest Palindromic Substring & 241.Different Ways to Add Parentheses
LeetCode 算法练习 Problem 5&241 思路小结原创 2017-03-05 18:18:41 · 212 阅读 · 0 评论 -
LeetCode 2.Add Two Numbers & 3.Longest Substring Without Repeating Characters
LeetCode 算法练习 Problem 2&3 思路小结原创 2017-02-26 19:03:41 · 273 阅读 · 0 评论 -
LeetCode 474.Ones and Zeroes & 486.Predict the Winner
动态编程(DP)原创 2017-05-03 18:34:02 · 251 阅读 · 0 评论 -
LeetCode 55.Jump Game & 56.Merge Intervals
Problem 55 Jump GameGiven 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 tha原创 2017-06-26 11:04:52 · 320 阅读 · 0 评论