LC729. My Calendar I

2022-10-12
阅读 1 分钟
677
[链接]MediumGoogle, Uber, Amazon, Twitch {代码...}

LC818 Race Car

2022-10-12
阅读 3 分钟
977
[链接]HardGoogle, Amazon第一种解法使用BFS {代码...} 第二种解法,DPdp[target] 表示行驶长度为target的距离需要的最小指示个数。dp[target]有两种可能:target刚好是由"AAA...A"一共n步到达,也就是一路加速,那么这种走法就是最优选择。如果不是上述情况,就有多种可能: a.第一次冲过target的时候进行'R'操作,然后...

LC 08 String to Integer (atoi)

2020-03-05
阅读 2 分钟
972
字符串转整数 字符串开头可能有很多空格,忽略之,直到找到第一个不是空格的字符。 第一个非空格字符可能是加号,减号,表示正数或负数。 继续向后碰到0-9就解析,碰到其他字符就终止。 若第一段连续数字为空,返回0. 如果整数大于Integer.MAX_VALUE,返回MAX_VALUE;若小于Integer.MIN_VALUE,返回MIN_VALUE。 {代码...}

Leetcode 1130 Minimum Cost Tree From Leaf Values

2019-12-19
阅读 3 分钟
2.8k
Given an array arr of positive integers, consider all binary trees such that:

LeetCode (Google) 679 _24Game

2018-04-21
阅读 2 分钟
2.5k
You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, )to get the value of 24.

LeetCode (Google) 541 _ 01 Matrix

2018-04-21
阅读 2 分钟
1.4k
Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell.

LeetCode(Google) 0276 Paint Fense

2018-04-21
阅读 1 分钟
1.7k
There is a fence with n posts, each post can be painted with one of the k colors.

LeetCode(Google) 0247 Strobogrammatic Number 2

2018-04-21
阅读 1 分钟
2k
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down).

LeetCode 238 Product of Array Except Self

2017-03-08
阅读 2 分钟
2.4k
Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O(n).

Leet code -- Combination Sum系列整理

2017-03-08
阅读 7 分钟
3.9k
Given 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 same repeated number may be chosen from C unlimited number of times.例如: [2, 3, 6, 7] and target 7