文章 2023-01-05 来自:开发者社区

LeetCode 414. Third Maximum Number

DescriptionGiven a non-empty array of integers, return the third maximum number in this array. If it does not exist, return the maximum number. The time complexity must be in O(n).Example 1:Input: [3....

LeetCode 414. Third Maximum Number
文章 2023-01-05 来自:开发者社区

LeetCode 405. Convert a Number to Hexadecimal

DescriptionGiven an integer, write an algorithm to convert it to hexadecimal. For negative integer, two’s complement method is used.Note:All letters in hexadecimal (a-f) must be in lowercase.The hexa....

LeetCode 405. Convert a Number to Hexadecimal
文章 2023-01-05 来自:开发者社区

LeetCode 375. Guess Number Higher or Lower II

DescriptionWe are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number I pi....

LeetCode 375. Guess Number Higher or Lower II
文章 2023-01-05 来自:开发者社区

LeetCode 374. Guess Number Higher or Lower

DescriptionWe are playing the Guess Game. The game is as follows:I pick a number from 1 to n. You have to guess which number I picked.Every time you guess wrong, I'll tell you whether the number is h....

LeetCode 374. Guess Number Higher or Lower
文章 2023-01-05 来自:开发者社区

LeetCode 321. Create Maximum Number

DescriptionGiven two arrays of length m and n with digits 0-9 representing two numbers. Create the maximum number of length k <= m + n from digits of the two. The relative order of the digits from....

LeetCode 321. Create Maximum Number
文章 2023-01-05 来自:开发者社区

LeetCode 313. Super Ugly Number

DescriptionWrite a program to find the nth super ugly number.Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k.Example:Input: n = 12, primes....

LeetCode 313. Super Ugly Number
文章 2023-01-05 来自:开发者社区

LeetCode 306. Additive Number

DescriptionAdditive number is a string whose digits can form additive sequence.A valid additive sequence should contain at least three numbers. Except for the first two numbers, each subsequent numbe....

LeetCode 306. Additive Number
文章 2023-01-05 来自:开发者社区

LeetCode 287. Find the Duplicate Number

DescriptionGiven an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicat....

LeetCode 287. Find the Duplicate Number
文章 2023-01-05 来自:开发者社区

LeetCode 268. Missing Number

DescriptionGiven an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.Example 1:Input: [3,0,1]Output: 2Example 2:Input: [9,6,4,2,3,5,7,0,1]Ou....

LeetCode 268. Missing Number
文章 2023-01-05 来自:开发者社区

LeetCode 264. Ugly Number II

DescriptionWrite a program to find the n-th ugly number.Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.Example:Input: n = 10Output: 12Explanation: 1, 2, 3, 4, 5, 6, 8, 9, ....

LeetCode 264. Ugly Number II

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注