2020년/코테

[코테연습] Combination Sum III

위지원 2020. 9. 14. 12:13

leetcode.com/problems/combination-sum-iii/submissions/

 

Combination Sum III - 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

Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.

Note:

  • All numbers will be positive integers.
  • The solution set must not contain duplicate combinations.

조합으로 풀었다... 사실 시간초과나거나 그럴줄 알고 순열조합은 안쓰려고했는데 1~9라는 숫자라서 혹시나 해서 했더니 통과되서 당황..