Test Task
The mission is in Blocked Mode.
Access to the solutions is blocked for a day or two (even after you share your own), until we'll have enough solutions for you to check.
All users who've solved the mission will get the notifications about their opening.
In a given set of integers, you need to remove minimum and maximum elements.
The second argument tells how many min and max elements should be removed.
Input: Two arguments. Set of ints and int.
Output: Set of ints
Example:
assert remove_min_max({8, 9, 18, 7}, 1) == {8, 9}
assert remove_min_max({8, 9, 7}, 0) == {8, 9, 7}
assert remove_min_max({8, 9, 7}, 2) == set()
assert remove_min_max({1, 2, 7, 8, 9}, 2) == {7}
How it’s used: (math is used everywhere)
Precondition: ints in the set is between -1000 and 1000; the second argument is between -1000 and 1000