is there a one-liner for this? the bulk of the cou...
# getting-started
o
is there a one-liner for this? the bulk of the counting pairs part of the problem I mean, not the end aggregation (but also there as well)
r
Copy code
fun sockMerchant(n: Int, ar: IntArray) = ar.groupBy { it }.values.sumBy { it.size / 2 }
💯 2
o
yea gussed as muc
thank you very much