본문 바로가기
반응형

Study86

[LeetCode] #77. Combinations (python) 문제 https://leetcode.com/problems/combinations/ Combinations - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 주어진 정수 n, k를 가지고 [1, n] 범위로 가능한 k개의 조합을 반환해야 한다. 예시 입출력 Input: n = 4, k = 2 Output: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] 풀이 책 풀이 1. dfs 활용 class Solution: def comb.. 2022. 3. 17.
[LeetCode] #46. Permutations (python) 문제 https://leetcode.com/problems/permutations/ Permutations - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 받은 정수 배열로 가능한 모든 순열을 반환해야한다. 예시 입출력 Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] 풀이 책 풀이 1. dfs 활용 class Solution: def permute(self, nums.. 2022. 3. 17.
[LeetCode] #17. Letter Combinations of a Phone Number (python) 문제 https://leetcode.com/problems/letter-combinations-of-a-phone-number/ Letter Combinations of a Phone Number - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 숫자 2-9는 각각 의미하는 문자들이 있는데 해당 번호로 가능한 모든 문자들의 조합을 반환해야 한다. 예시 입출력 Input: digits = "23" Output: ["ad","ae","af","bd","be","bf.. 2022. 3. 17.
[LeetCode] #200. Number of Islands (python) 문제 https://leetcode.com/problems/number-of-islands/ Number of Islands - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 1을 땅, 0은 물을 의미하는 2차원 배열이 주어졌을 때 섬의 개수를 계산해야 한다. 예시 입출력 Input: grid = [ ["1","1","1","1","0"], ["1","1","0","1","0"], ["1","1","0","0","0"], ["0","0","0","0","0"] .. 2022. 3. 17.
반응형