K40
Letter Combinations of a Phone Number
Problem Statement & Objective
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent on a phone keypad.
Function Signature (Python)
letter_combinations(digits: str) -> list[str]Input & Output Contract
Output Rule:Harf kombinasyonları listesi.
System Constraints
0 <= rakamlar.length <= 4
rakamlar yalnızca '2'-'9' arası karakterler içerirExample Execution Walkthrough
rakamlar = '23' -> ['ad','ae','af','bd','be','bf','cd','ce','cf']Example Test Scenarios (3)
Example 1
Input:
["23"]Expected Output:
["ad","ae","af","bd","be","bf","cd","ce","cf"]Example 2: Boş Girdi
Input:
[""]Expected Output:
[]Example 3: Tek Rakam
Input:
["2"]Expected Output:
["a","b","c"]