I hereby claim:
- I am fredysierra on github.
- I am fysus (https://keybase.io/fysus) on keybase.
- I have a public key ASA4ZBobKr2LoVRPlhwLnFOgBehVIIEAXwax0VrIV-nY7Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
val array = List(1, 3, 4, 5, 2, 2, 3, 2, 5, 5, 5) | |
val sarray = array.sorted | |
val (count, maxcount, number, thenumber) = sarray.foldLeft((0, 0, 0, 0)) { (acc, v) => | |
{ | |
val (count, maxcount, number, thenumber) = acc | |
if (number == v) { | |
(count + 1, maxcount, number, thenumber) | |
} else { | |
if (count >= maxcount) { | |
if (count == maxcount) |