1. 题目 Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If …
分类:LeetCode题目解答
[LeetCode] Integer to English Words 整数转为英文单词
Convert a non-negative integer to its english words representation. Given input is guaranteed to be les…
542. 01 Matrix
Given a matrix consists of 0 and 1, find the distance of the nearest 0 for each cell. The distance between two…
[Leetcode] Count Primes 数素数
Count Primes Description: Count the number of prime numbers less than a non-negative number, n. 埃拉托斯特尼筛法 Sieve…
[LeetCode] Merge Two Sorted Lists 混合插入有序链表
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing toge…
[LeetCode] Unique Paths II 不同的路径之二
Follow up for “Unique Paths”: Now consider if some obstacles are added to the grids. How ma…
[LeetCode] Best Time to Buy and Sell Stock III 买股票的最佳时间之三
Say you have an array for which the ith element is the price of a given stock on day i. …
LeetCode 134. Gas Station
题目 There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You have a…
[LeetCode] Maximum Product Subarray 求最大子数组乘积
Given an integer array nums, find the contiguous subarray within an array (containing at least one…
[LeetCode] Pyramid Transition Matrix 金字塔转变矩阵
We are stacking blocks to form a pyramid. Each block has a color which is a one letter string, like `…
[Leetcode] Copy List with Random Pointer 复制随机指针
Copy List with Random Pointer A linked list is given such that each node contains an additional random pointer…
【leetcode】44. Wildcard Matching 通配符匹配
1. 题目 Implement wildcard pattern matching with support for ‘?’ and ‘*’. ‘?’…