O63

Largest Number from Array

Mid / Senior Engineer
Target Time: 25 - 35 Minutes
Type: STRING

Problem Statement & Objective

Given a list of non-negative integers nums, arrange them such that they form the largest possible number as a string.

Function Signature (Python)

largest_number_from_array(nums: list[int]) -> str

Input & Output Contract

Output Rule:Oluşturulan en büyük sayının metin temsili.

System Constraints

1 <= sayilar.length <= 100
0 <= sayilar[i] <= 10^9

Example Execution Walkthrough

sayilar = [10, 2] -> '210'
sayilar = [3, 30, 34, 5, 9] -> '9534330'

Example Test Scenarios (3)

Example 1
Input:[[10,2]]
Expected Output:"210"
Example 2
Input:[[3,30,34,5,9]]
Expected Output:"9534330"
Example 3: Sıfırlar
Input:[[0,0]]
Expected Output:"0"
Loading Python Editor...
Input Parameters
[
  [
    10,
    2
  ]
]
Expected Output
"210"