Question: Problem 2 [35 points] Given an integer array nums (no duplicates) and integer k , return all possible subsets of nums of size k .

Problem 2 [35 points]

Given an integer array nums (no duplicates) and integer k, return all possible subsets of nums of size k. Your output must not contain duplicate subsets.

USE THIS:

def get_subsets(nums, k):

return []

2. Test your implementation by calling it multiple times with different input values and comparing the output produced by your method and the expected output. For each test, add a short comment explaining why you think that test is appropiate. Do not write an excesive amount of tests; just write the number of tests you think you need and justify your decisions.

# Your test cases go here TEST CASE HERE

INFORMATION BELOW:

Examples: nums = [1,2,3] k= 1  [ [3], [1], [2] ] nums = [1,2,3] k= 2  [ [1,3], [2,3], [1,2] ] nums = [1,2,3] k= 0  [ [] ] nums = [1,2,3] k= 3  [ [1,2,3] ]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!