K09
Shelf Item Length Sort
Problem Statement & Objective
Sort bookstore or warehouse items by length with secondary alphabetical ordering.
Function Signature (Python)
shelf_item_length_sort(words: list[str]) -> strInput & Output Contract
Output Rule:Boşlukla ayrılmış tek metin. Boş liste için boş metin "".
System Constraints
0 <= kelimeler.length <= 10^4
1 <= kelimeler[i].length <= 30
kelimeler yalnızca küçük ASCII harf içerir, tekrar yokturExample Execution Walkthrough
kelimeler = ["elma", "armut", "kiraz", "nar"]
uzunluklar: elma=4, armut=5, kiraz=5, nar=3
sıralama: nar(3) -> elma(4) -> armut(5) -> kiraz(5)
cevap: "nar elma armut kiraz"Example Test Scenarios (3)
Example 1
Input:
[["elma","armut","kiraz","nar"]]Expected Output:
"nar elma armut kiraz"Example 2: Programlama Dilleri
Input:
[["python","go","rust","c","java"]]Expected Output:
"c go java rust python"Example 3: Eşit ve Farklı Boyutlar
Input:
[["ayva","muz","dut"]]Expected Output:
"dut muz ayva"