We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
funclonelyinteger(a:[Int])->Int{vardict=[Int:Bool]()a.forEach{valuein// will nil the dictionary entry if more than 1 occurrenceifdict[value]!=nil{dict[value]=nil}else{dict[value]=true}}// should only be 1 entry leftreturndict.keys.first??-1}
Cookie support is required to access HackerRank
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 →
Swift: