Package g0101_0200.s0179_largest_number
Class Solution
java.lang.Object
g0101_0200.s0179_largest_number.Solution
179 - Largest Number.<p>Medium</p>
<p>Given a list of non-negative integers <code>nums</code>, arrange them such that they form the largest number.</p>
<p><strong>Note:</strong> The result may be very large, so you need to return a string instead of an integer.</p>
<p><strong>Example 1:</strong></p>
<p><strong>Input:</strong> nums = [10,2]</p>
<p><strong>Output:</strong> “210”</p>
<p><strong>Example 2:</strong></p>
<p><strong>Input:</strong> nums = [3,30,34,5,9]</p>
<p><strong>Output:</strong> “9534330”</p>
<p><strong>Example 3:</strong></p>
<p><strong>Input:</strong> nums = [1]</p>
<p><strong>Output:</strong> “1”</p>
<p><strong>Example 4:</strong></p>
<p><strong>Input:</strong> nums = [10]</p>
<p><strong>Output:</strong> “10”</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>
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Solution
public Solution()
-
-
Method Details
-
largestNumber
-