You are viewing a single comment's thread. Return to all comments →
In Scala:
def f(arr:List[Int]):Int = { var res1 : Int = (arr.zipWithIndex.filter(_.2 != 0).map(._2)).last res1 = res1 + 1 return res1 }
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:
def f(arr:List[Int]):Int = { var res1 : Int = (arr.zipWithIndex.filter(_.2 != 0).map(._2)).last res1 = res1 + 1 return res1 }