3 questions
1
vote
3
answers
64
views
Using Kotlin HOFs to split, transform, and join elements from String list
Goal:
Given a list of String representing IP addresses
split into 4 octets by removing '.'
transform split pieces by padding with zeros (if size == 1 or 2)
join pieces into a 12-char String, ...
5
votes
4
answers
7k
views
Kotlin Higher Order Function Composition
I'm trying to figure out how I can declaritively define a function as a composition of two other functions in Kotlin but I'm struggling. Here is my code:
fun compose(a: (Int, Int) -> Int, b: (Int, ...