[LeetCode] 17. Letter Combinations of a Phone Number, Medium
·
CodingTest/LeetCode
1. 문제문자열 digits이 2-9로 이루어져 있고, 그림처럼 구성된 번호가 있을 때, 조합할 수 있는 모든 문자 조합을 반환하라.2. 해결function letterCombinations(digits: string): string[] { if(digits.length === 0) return [] const map = new Map(); map.set('2', ['a', 'b','c']) map.set('3', ['d', 'e','f']) map.set('4', ['g', 'h','i']) map.set('5', ['j', 'k','l']) map.set('6', ['m', 'n','o']) map.set('7', ['p', 'q','r','s']) m..