less than 1 minute read

Given a list of integers nums, rearrange its order to form the largest possible integer and return it as a string.

Constraints

  • n ≤ 1,000 where n is the length of nums
  • nums[i] ≤ 1,000

https://binarysearch.com/problems/Create-Largest-Number-From-a-List

Examples

Example 1

Input

  • nums = [10, 7, 76, 415]

Output

  • answer = 77641510

Example 2

Input

  • nums = [961, 745, 331, 794, 923]

Output

  • answer = 961923794745331

Example 3

Input

  • nums = [45, 14, 70, 67, 95]

Output

  • answer = 9570674514

Example 4

Input

  • nums = [70, 5, 94, 18, 78]

Output

  • answer = 947870518

Solution

Categories:

Updated:

Leave a comment