Combinations

Title: Combinations Source: leetcode.com

Given two integers n and k, return all possible combinations of k numbers out of 1 … n.

For example,
If n = 4 and k = 2, a solution is:

Python solution (a)

Python solution (b)

Rate this post

Leave a Reply