![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
文章平均质量分 66
大师兄0612
这个作者很懒,什么都没留下…
展开
-
Leetcode 64(Minimum Path Sum)
Question:Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or righ原创 2015-07-26 11:09:11 · 323 阅读 · 0 评论 -
Leetcode 137: (Single Number II)
Given an array of integers, every element appears three times except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without us原创 2016-04-13 20:20:20 · 339 阅读 · 0 评论 -
Leetcode 142: Linked List Cycle II & Leetcode 287: Find the Duplicate Number
Leetcode 142: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. 解题思路:设置两个指针,一个快(fp), 一个慢(sp)。fp每次走两步,速度是2v2v,sp每原创 2016-04-13 13:48:55 · 293 阅读 · 0 评论 -
Leetcode 264(Ugly Number II)
QuestionWrite a program to find the nthn^{th} ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5. For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the原创 2015-08-19 13:31:36 · 804 阅读 · 0 评论 -
LeetCode 119(Pascal's Triangle II)
QuestionGiven an index k, return the kthk^{th} row of the Pascal’s triangle.For example, given k=3k = 3,Note:Could you optimize your algorithm to use only O(k) extra space?Analysis帕斯卡三角,也就是传说中的杨辉三角。其形状原创 2015-08-05 22:16:14 · 325 阅读 · 0 评论 -
LeetCode 190(Reverse Bits)
QuestionReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 001110原创 2015-08-18 10:51:01 · 666 阅读 · 0 评论 -
Leetcode201(Bitwise AND of Numbers Range)
QuestionGiven a range [m,n][m, n] where 0<=m<=n<=21474836470 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For example, given the range [5,7][5, 7], you should原创 2015-08-16 23:44:26 · 384 阅读 · 0 评论 -
LeetCode75(Sort Color)
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 blue.原创 2015-07-21 23:14:36 · 397 阅读 · 0 评论 -
Leetcode135(Candy)
Question原文引自> https://leetcode.com/problems/candy/There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requ原创 2015-07-28 22:30:59 · 406 阅读 · 0 评论 -
Leetcode 134(Gas Station)
QuestionThere are N gas stations along a circular route, where the amount of gas at station ii is gas[i]gas[i].原创 2015-07-29 12:54:32 · 410 阅读 · 0 评论 -
Leetcode 343(Integer Break非动态规划求解)
问题 Given a positive integer n, break it into the sum of at least two positive integers and maximize the product of those integers. Return the maximum product you can get. For example, given n = 2,原创 2016-04-20 10:27:52 · 616 阅读 · 0 评论