You are viewing a single comment's thread. Return to all comments →
Scala code:
def lonelyinteger(a: Array[Int]): Int = { val distinctElements = a.distinct val repeatElements = a.diff(distinctElements) val uniqueInteger = (distinctElements diff repeatElements)(0) uniqueInteger }
Seems like cookies are disabled on this browser, please enable them to open this website
Lonely Integer
You are viewing a single comment's thread. Return to all comments →