Issue
Does Kotlin have a function like .zipAll
in Scala?
In Scala I can sum two array with different length using the zipAll function.
Scala:
val arrA = Array(1,2,3)
val arrB = Array(4, 5)
arrA.zipAll(arrB, 0, 0).map(x => x._1 + x._2)
Or what is the correct way to do this in Kotlin?
Solution
There is no in-build analog in Kotlin 1.0. It might be a good idea to add it into the stdlib. Feel free to file an issue on the YouTrack
Answered By - voddan
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.