완전탐색
-
[LeetCode] Generate Parentheses알고리즘 2019. 9. 26. 02:19
문제 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: [ "((()))", "(()())", "(())()", "()(())", "()()()" ] Approach (의 최대 개수는 n개이고 )는 n이 등장한 만큼만 나와야한다 이 조건을 만족하며 완전탐색을 한다 Code https://github.com/chi3236/algorithm/blob/master/LeetCode_GenerateParentheses.cpp chi3236/algorithm Contribute to chi3236/al..
-
[LeetCode] Letter Combinations of a Phone Number알고리즘 2019. 9. 21. 21:03
문제 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. 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: Input: "23" Output: ["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]. Note: Although the above answer is in lexicographical order,..