This repository has been archived on 2024-05-04. You can view files and clone it, but cannot push or open issues or pull requests.
|
package space.dezentrale.prgrnd
|
|
fun containsDuplicate(nums: IntArray): Boolean {
|
|
val unicates: MutableSet<Int> = mutableSetOf()
|
|
nums.forEach {
|
|
if (unicates.contains(it)) {
|
|
return true
|
|
} else {
|
|
unicates.add(it)
|
|
}
|
|
}
|
|
return false
|
|
} |