Problem Statement
A description of the problem can be found on Hackerrank.
Solution
1 2 3 |
object SumOddElements extends App{ def f(arr:List[Int]):Int = arr.filter(_ % 2 != 0).sum } |
Solution also available on my GitHub.
Problem Statement
A description of the problem can be found on Hackerrank.
Solution
1 2 3 |
object SumOddElements extends App{ def f(arr:List[Int]):Int = arr.filter(_ % 2 != 0).sum } |
Solution also available on my GitHub.