179. Largest Number
Description
Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.
Since the result may be very large, so you need to return a string instead of an integer.
Example 1:
1 | Input: nums = [10,2] |
Example 2:
1 | Input: nums = [3,30,34,5,9] |
Constraints:
1 <= nums.length <= 1000 <= nums[i] <= 10^9
Hints/Notes
- 2025/02/01 Q1
- string
- Good solution
Solution
Language: C++
1 | class Solution { |