Last active
November 1, 2016 13:14
-
-
Save Dima564/b0d1b283f2211f199cc88ecf0dac5920 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun flatTree(tree: TreeNode): List<TreeNode> | |
= listOf(tree, *tree.children.flatMap(::flatTree).toTypedArray()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment