You are viewing a single comment's thread. Return to all comments →
In scala, this can be done with reduce operation
arr.reduce((count, item) => count + 1)
However, this does not work in hackerrank. It works in my scala REPL though.
Seems like cookies are disabled on this browser, please enable them to open this website
List Length
You are viewing a single comment's thread. Return to all comments →
In scala, this can be done with reduce operation
arr.reduce((count, item) => count + 1)
However, this does not work in hackerrank. It works in my scala REPL though.