val result: Map<String, List<String>> = listOf("one", "two", "three").groupBy {
if (it.contains("n")) "nCount"
else if (it.contains("x")) "xCount"
else "others"
}
t
tginiotis
11/21/2018, 3:01 PM
this one works in essence for the contrived example. But I kind of think that this is essentially merging the fold functions by hand. Also if a fold produced a different type than the others, I think this would no longer work