You are viewing a single comment's thread. Return to all comments →
Yup, very close to my solution which is a bit faster:
def f(arr:List[Int]):List[Int] = arr.view.zipWithIndex.filter { _._2 % 2 != 0 }.map { _._1}.force.toList
Seems like cookies are disabled on this browser, please enable them to open this website
Filter Positions in a List
You are viewing a single comment's thread. Return to all comments →
Yup, very close to my solution which is a bit faster: