To clear or not to clear

Report a typo

You are given a MutableSet of integers and an integer as input. Check if the given integer is present in the MutableSet. If so, return an empty Set. If not, just return the same set.

Sample Input 1:

8 11
11

Sample Output 1:


Sample Input 2:

5 6 7
0

Sample Output 2:

5 6 7
Write a program in Kotlin
fun solution(elements: MutableSet<Int>, element: Int): MutableSet<Int> {
// put your code here
}
___

Create a free account to access the full topic