Array Largest Number Combination LeetCode (Largest Number - Arrange given numbers to form biggest number)

Given a list of non negative integers, arrange them such that they form the largest number.

Example 1:
  • Input: [10,2]
  • Output: "210"
Example 2:
  • Input: [3,30,34,5,9]
  • Output: "9534330"
NOTE: The result may be very large, so you need to return a string instead of an integer.

 This problem is quite popular in GeeksForGeeks and LeetCode A collection of hundreds of interview questions and solutions are available in our blog at Interview Question Solutions

Solution:

 

No comments:

Post a Comment