2022-03-27 18:35:17 +08:00
|
|
|
<p>Given a list of non-negative integers <code>nums</code>, arrange them such that they form the largest number and return it.</p>
|
|
|
|
|
|
|
|
<p>Since the result may be very large, so you need to return a string instead of an integer.</p>
|
|
|
|
|
|
|
|
<p> </p>
|
2023-12-09 18:42:21 +08:00
|
|
|
<p><strong class="example">Example 1:</strong></p>
|
2022-03-27 18:35:17 +08:00
|
|
|
|
|
|
|
<pre>
|
|
|
|
<strong>Input:</strong> nums = [10,2]
|
|
|
|
<strong>Output:</strong> "210"
|
|
|
|
</pre>
|
|
|
|
|
2023-12-09 18:42:21 +08:00
|
|
|
<p><strong class="example">Example 2:</strong></p>
|
2022-03-27 18:35:17 +08:00
|
|
|
|
|
|
|
<pre>
|
|
|
|
<strong>Input:</strong> nums = [3,30,34,5,9]
|
|
|
|
<strong>Output:</strong> "9534330"
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
<p><strong>Constraints:</strong></p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li><code>1 <= nums.length <= 100</code></li>
|
|
|
|
<li><code>0 <= nums[i] <= 10<sup>9</sup></code></li>
|
|
|
|
</ul>
|