매핑2 [leetcode 136] Single Number Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. Follow up: Could you implement a solution with a linear runtime complexity and without using extra memory? 한 번만 등장한 원소 찾기 Example 1: Input: nums = [2,2,1] Output: 1 Example 2: Input: nums = [4,1,2,1,2] Output: 4 Example 3: Input: nums = [1] Output: 1 문제 풀이: - follow up을 무시하고 map으로 풀면 쉽게 풀린.. 2020. 10. 21. [leetcode 17] Letter Combinations of a Phone Number Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. 전형적인 백트래킹 문제. 숫자에 해당하는 알파벳의 조합을 모두 찾기 Example 1: Input: digits = "23" Output: ["ad","ae","af","bd","be","bf","cd","c.. 2020. 10. 14. 이전 1 다음