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.
Mutable Set
To clear or not to clear
Report a typo
Sample Input 1:
8 11
11Sample Output 1:
Sample Input 2:
5 6 7
0Sample Output 2:
5 6 7Write a program in Kotlin
fun solution(elements: MutableSet<Int>, element: Int): MutableSet<Int> {
// put your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.