You are viewing a single comment's thread. Return to all comments →
Hello, If I do this in Scala, I'm getting a timeout on several testcases -
def equal(arr: Array[Int]): Int = Array(0, 1, 2).map(x => (arr.map(y => {val dist = y - (arr.min-x); dist/5 + (dist%5)/2 + (dist%5)%2}).sum)).min`
What am I doing wrong?
Seems like cookies are disabled on this browser, please enable them to open this website
Equal
You are viewing a single comment's thread. Return to all comments →
Hello, If I do this in Scala, I'm getting a timeout on several testcases -
What am I doing wrong?