加载中...
分类详情
简单 分类
1-两数之和(Two Sum)
原文链接: https://leetcode-cn.com/problems/two-sum 英文原文Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may n…
2021-12-03
7-整数反转(Reverse Integer)
原文链接: https://leetcode-cn.com/problems/reverse-integer 英文原文Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 - 1], then return 0. Assume the en…
2021-12-03
9-回文数(Palindrome Number)
原文链接: https://leetcode-cn.com/problems/palindrome-number 英文原文Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is palindrome while 123 is not. Example 1…
2021-12-03
14-最长公共前缀(Longest Common Prefix)
原文链接: https://leetcode-cn.com/problems/longest-common-prefix 英文原文Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string "". Example 1: Input: strs = ["flower","flow"…
2021-12-03
20-有效的括号(Valid Parentheses)
原文链接: https://leetcode-cn.com/problems/valid-parentheses 英文原文Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the sam…
2021-12-03
58-最后一个单词的长度(Length of Last Word)
原文链接: https://leetcode-cn.com/problems/length-of-last-word 英文原文Given a string s consisting of some words separated by some number of spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space chara…
2021-12-03
66-加一(Plus One)
原文链接: https://leetcode-cn.com/problems/plus-one 英文原文You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-…
2021-12-03
67-二进制求和(Add Binary)
原文链接: https://leetcode-cn.com/problems/add-binary 英文原文Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = "11", b = "1" Output: "100" Example 2: Input: a = "1010", b = "1011" Output: "10101" Constraints: 1 <= …
2021-12-03
69-Sqrt(x)
原文链接: https://leetcode-cn.com/problems/sqrtx 英文原文Given a non-negative integer x, compute and return the square root of x. Since the return type is an integer, the decimal digits are truncated, and only the integer part of the result is returned. Note…
2021-12-03
70-爬楼梯(Climbing Stairs)
原文链接: https://leetcode-cn.com/problems/climbing-stairs 英文原文You are climbing a staircase. It takes n steps to reach the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top? Example 1: Input: n = 2 Outpu…
2021-12-03
112-路径总和(Path Sum)
原文链接: https://leetcode-cn.com/problems/path-sum 英文原文Given the root of a binary tree and an integer targetSum, return true if the tree has a root-to-leaf path such that adding up all the values along the path equals targetSum. A leaf is a node with no…
2021-12-03
118-杨辉三角(Pascal's Triangle)
原文链接: https://leetcode-cn.com/problems/pascals-triangle 英文原文Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: Example 1: Input: numRows…
2021-12-03
119-杨辉三角 II(Pascal's Triangle II)
原文链接: https://leetcode-cn.com/problems/pascals-triangle-ii 英文原文Given an integer rowIndex, return the rowIndexth (0-indexed) row of the Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: Exam…
2021-12-03
125-验证回文串(Valid Palindrome)
原文链接: https://leetcode-cn.com/problems/valid-palindrome 英文原文A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric …
2021-12-03