LeetCode 179, Medium. Topics: Array, String, Greedy, Sorting. View on LeetCode.
Generate this problem as a practice environment: tested reference solution, 16 parametrized pytest cases, and a playground notebook:
Problem
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, you need to return a string instead of an integer.
Examples
Constraints
- 1 <= nums.length <= 100
- 0 <= nums[i] <= 10^9
Solution
Reference implementation from solution.py on GitHub, full suite in test_solution.py:
Complexity
Grind, NeetCode All. Last modified on September 7, 2026