You are viewing a single comment's thread. Return to all comments →
Kotlin
fun missingNumbers(arr: Array<Int>, brr: Array<Int>): List<Int> { val countMap = brr.groupingBy { it }.eachCount().toMutableMap() arr.forEach { y -> countMap[y]?.let { count -> if (count > 1) countMap[y] = count - 1 else countMap.remove(y) } } return countMap.keys.sorted() }
Seems like cookies are disabled on this browser, please enable them to open this website
Missing Numbers
You are viewing a single comment's thread. Return to all comments →
Kotlin