Ok, So isEmpty check is replaced by having an initial value as parameter of fold. case for 1 or more is handled by lambda. I think I understand it now. So those check-steps are not needed anymore.
acc will be initialized as empty setOf string because that is what is passed inside fold(), c will be current iterated value. and then you call combineSolutions with acc and mapPin of c.
Ok, So
isEmpty
check is replaced by having an initial value as parameter of fold. case for 1 or more is handled by lambda. I think I understand it now. So those check-steps are not needed anymore.acc
will be initialized as empty setOf string because that is what is passed inside fold(),c
will be current iterated value. and then you callcombineSolutions
with acc and mapPin of c.Man lambdas are trippy.
Exactly 👏🏻