Lonely Integer

  • + 0 comments

    Kotlin Solution

    fun lonelyinteger(a: Array<Int>): Int {
        return a.groupingBy { it }.eachCount().filterValues { it == 1 }.keys.first()   
    }