Largest Number

Medium · Greedy · about 20 minutes

Asked at Amazon, Microsoft, Google, Meta, Adobe, Canva, Grammarly, Electronic Arts, Unity, Autodesk.

Arrange the non-negative integers in nums side by side, in whatever order gives the biggest number, and return it as a string (it may be too big for any integer type). When the result is all zeros, return "0".