egorand
07/20/2019, 2:55 AMT
which gets flattened into a list of T
. Here’s an example:
[[1, 2, 3], [4], [5, 6]] -> flatten -> [1, 2, 3, 4, 5, 6]
Ifvwm
07/20/2019, 3:16 AMShawn
07/20/2019, 3:38 AMIfvwm
07/20/2019, 3:44 AMDico
07/20/2019, 7:47 AMsealed class Tree<T> {
class Leaf<T>(val value: T) : Tree<T>()
class Node<T>(val left: Tree<T>, val right: Tree<T>) : Tree<T>()
}