codingstuff.io
ExploreTutorialsProblemsCS Subjects
Get Started
ExploreTutorialsProblemsCS Subjects
Get Started
codingstuff.io

Master the art of building software through interactive tutorials, real-world problems, and guided projects.

Pune, Maharashtra, India

codingstuffmail@gmail.com

Product

  • Explore
  • Tutorials
  • Problems
  • CS Subjects

Company

  • About
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Sitemap

© 2026 codingstuff.io. All rights reserved.

Built with ❤️ for developers everywhere

ProblemsCombination Sum III

Combination Sum III

Medium
BacktrackingArrays

Find all valid combinations of k numbers that sum up to n such that only numbers 1 through 9 are used and each number is used at most once.

Return a list of all possible valid combinations.

 

Example 1:

Input: k = 3, n = 7
Output: [[1,2,4]]
Explanation: 1 + 2 + 4 = 7

Example 2:

Input: k = 3, n = 9
Output: [[1,2,6],[1,3,5],[2,3,4]]

 

Constraints:

  • 2 <= k <= 9
  • 1 <= n <= 60

Related Problems

View all
Subsets
Medium•Recursion
Combination Sum
Medium•Recursion
Permutations
Medium•Recursion
Subsets II
Medium•Recursion
Combination Sum II
Medium•Recursion
Word Search
Medium•Recursion
Input:
k = 3, n = 7