-
Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return th...
-
28. Implement strStr()
Implement strStr().
Return the index of the first occurrence of needle in haystack, or -1 if needle is...
-
62. Unique Paths I
给定一个m*n的棋盘,从棋盘左上角到棋盘右下角最多有多少条路径。
每一次移动,只能向右移一格或者向下移动一格。
star
end
动态规划问题:
dp[i][j] =...
-
35. Search Insert Position
Given a sorted array and a target value, return the index if the target is found. If not, return t...
-
746. Min Cost Climbing Stairs
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).
Once you...
-
###53. Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest ...
-
###14. Longest Common Prefix
Write a function to find the longest common prefix string amongst an array of strings.
最初始的想法...
-
50. Pow(x, n)
Implement pow(x, n).
Example 1:
123Input: 2.00000, 10Output: 1024.00000
Example 2:
12Input: 2.10000, 3Output: ...
-
9. Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.
用一个变量reverse来保存翻转的x部分
rever...
-
8. String to Integer (atoi)
Implement atoi to convert a string to an integer.
Hint: Carefully consider all possible input cas...