原文链接: https://leetcode-cn.com/problems/add-two-numbers 英文原文You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers a…
标签详情
数学 分类
原文链接: 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…
原文链接: 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…
原文链接: https://leetcode-cn.com/problems/integer-to-roman 英文原文Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just tw…
原文链接: https://leetcode-cn.com/problems/roman-to-integer 英文原文Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just tw…
原文链接: https://leetcode-cn.com/problems/divide-two-integers 英文原文Given two integers dividend and divisor, divide two integers without using multiplication, division, and mod operator. The integer division should truncate toward zero, which means losing…
原文链接: https://leetcode-cn.com/problems/multiply-strings 英文原文Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string. Note: You must not use any built-in BigInteger librar…
原文链接: https://leetcode-cn.com/problems/rotate-image 英文原文You are given an n x n 2D matrix representing an image, rotate the image by 90 degrees (clockwise). You have to rotate the image in-place, which means you have to modify the input 2D matrix dire…
原文链接: https://leetcode-cn.com/problems/powx-n 英文原文Implement pow(x, n), which calculates x raised to the power n (i.e., xn). Example 1: Input: x = 2.00000, n = 10 Output: 1024.00000 Example 2: Input: x = 2.10000, n = 3 Output: 9.26100 Example 3: Input…
原文链接: https://leetcode-cn.com/problems/unique-paths 英文原文A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach t…
原文链接: 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-…
原文链接: 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 <= …
原文链接: 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…
原文链接: 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…
原文链接: https://leetcode-cn.com/problems/gray-code 英文原文An n-bit gray code sequence is a sequence of 2n integers where: Every integer is in the inclusive range [0, 2n - 1], The first integer is 0, An integer appears no more than once in the sequence, Th…
原文链接: https://leetcode-cn.com/problems/unique-binary-search-trees 英文原文Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n. Example 1: Input: n = 3 Output: 5 E…
原文链接: https://leetcode-cn.com/problems/max-points-on-a-line 英文原文Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line. Example 1: Input: points …
原文链接: https://leetcode-cn.com/problems/evaluate-reverse-polish-notation 英文原文Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, and /. Each operand may be an integer or another expression. Note that…
原文链接: https://leetcode-cn.com/problems/fraction-to-recurring-decimal 英文原文Given two integers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part is repeating, enclose the repeating par…
原文链接: https://leetcode-cn.com/problems/excel-sheet-column-title 英文原文Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 AB -> 28 ... Example 1: I…
原文链接: https://leetcode-cn.com/problems/excel-sheet-column-number 英文原文Given a string columnTitle that represents the column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> …
原文链接: https://leetcode-cn.com/problems/factorial-trailing-zeroes 英文原文Given an integer n, return the number of trailing zeroes in n!. Note that n! = n * (n - 1) * (n - 2) * ... * 3 * 2 * 1. Example 1: Input: n = 3 Output: 0 Explanation: 3! = 6, no tra…
原文链接: https://leetcode-cn.com/problems/rotate-array 英文原文Given an array, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the righ…
原文链接: https://leetcode-cn.com/problems/happy-number 英文原文Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squa…
原文链接: https://leetcode-cn.com/problems/count-primes 英文原文Given an integer n, return the number of prime numbers that are strictly less than n. Example 1: Input: n = 10 Output: 4 Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.…
原文链接: https://leetcode-cn.com/problems/rectangle-area 英文原文Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles. The first rectangle is defined by its bottom-left corner (ax1, ay1) and …
原文链接: https://leetcode-cn.com/problems/basic-calculator 英文原文Given a string s representing a valid expression, implement a basic calculator to evaluate it, and return the result of the evaluation. Note: You are not allowed to use any built-in function…
原文链接: https://leetcode-cn.com/problems/basic-calculator-ii 英文原文Given a string s which represents an expression, evaluate this expression and return its value. The integer division should truncate toward zero. You may assume that the given expression …
原文链接: https://leetcode-cn.com/problems/power-of-two 英文原文Given an integer n, return true if it is a power of two. Otherwise, return false. An integer n is a power of two, if there exists an integer x such that n == 2x. Example 1: Input: n = 1 Output: …
原文链接: https://leetcode-cn.com/problems/number-of-digit-one 英文原文Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. Example 1: Input: n = 13 Output: 6 Example 2: Input: n = 0 Output: 0 …
1 / 11