加载中...
分类详情
简单 分类
263-丑数(Ugly Number)
原文链接: https://leetcode-cn.com/problems/ugly-number 英文原文An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5. Given an integer n, return true if n is an ugly number. Example 1: Input: n = 6 Output: true Explanation: 6 = …
2021-12-03
283-移动零(Move Zeroes)
原文链接: https://leetcode-cn.com/problems/move-zeroes 英文原文Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. E…
2021-12-03
290-单词规律(Word Pattern)
原文链接: https://leetcode-cn.com/problems/word-pattern 英文原文Given a pattern and a string s, find if s follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in s. Example …
2021-12-03
292-Nim 游戏(Nim Game)
原文链接: https://leetcode-cn.com/problems/nim-game 英文原文You are playing the following Nim Game with your friend: Initially, there is a heap of stones on the table. You and your friend will alternate taking turns, and you go first. On each turn, the perso…
2021-12-03
326-3的幂(Power of Three)
原文链接: https://leetcode-cn.com/problems/power-of-three 英文原文Given an integer n, return true if it is a power of three. Otherwise, return false. An integer n is a power of three, if there exists an integer x such that n == 3x. Example 1: Input: n = 27 O…
2021-12-03
338-比特位计数(Counting Bits)
原文链接: https://leetcode-cn.com/problems/counting-bits 英文原文Given an integer n, return an array ans of length n + 1 such that for each i (0 <= i <= n), ans[i] is the number of 1's in the binary representation of i. Example 1: Input: n = 2 Output: [0,1,1…
2021-12-03
342-4的幂(Power of Four)
原文链接: https://leetcode-cn.com/problems/power-of-four 英文原文Given an integer n, return true if it is a power of four. Otherwise, return false. An integer n is a power of four, if there exists an integer x such that n == 4x. Example 1: Input: n = 16 Outp…
2021-12-03
344-反转字符串(Reverse String)
原文链接: https://leetcode-cn.com/problems/reverse-string 英文原文Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place with O(1) extra memory. Example 1: Input:…
2021-12-03
383-赎金信(Ransom Note)
原文链接: https://leetcode-cn.com/problems/ransom-note 英文原文Given two stings ransomNote and magazine, return true if ransomNote can be constructed from magazine and false otherwise. Each letter in magazine can only be used once in ransomNote. Example 1: I…
2021-12-03
401-二进制手表(Binary Watch)
原文链接: https://leetcode-cn.com/problems/binary-watch 英文原文A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59). Each LED represents a zero or one, with the least significant bi…
2021-12-03
412-Fizz Buzz
原文链接: https://leetcode-cn.com/problems/fizz-buzz 英文原文Given an integer n, return a string array answer (1-indexed) where: answer[i] == "FizzBuzz" if i is divisible by 3 and 5. answer[i] == "Fizz" if i is divisible by 3. answer[i] == "Buzz" if i is div…
2021-12-03
414-第三大的数(Third Maximum Number)
原文链接: https://leetcode-cn.com/problems/third-maximum-number 英文原文Given an integer array nums, return the third distinct maximum number in this array. If the third maximum does not exist, return the maximum number. Example 1: Input: nums = [3,2,1] Outp…
2021-12-03
415-字符串相加(Add Strings)
原文链接: https://leetcode-cn.com/problems/add-strings 英文原文Given two non-negative integers, num1 and num2 represented as string, return the sum of num1 and num2 as a string. You must solve the problem without using any built-in library for handling large…
2021-12-03