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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started