Skip to content

Instantly share code, notes, and snippets.

@VyacheslavMik
Last active June 3, 2022 11:26
Show Gist options
  • Save VyacheslavMik/0a543e95346d92fa26fd88fa029c6346 to your computer and use it in GitHub Desktop.
Save VyacheslavMik/0a543e95346d92fa26fd88fa029c6346 to your computer and use it in GitHub Desktop.
(fn-1 [{:id 1
:name "Foo"
:children [{:id 2
:name "Bar"
:children [{:id 3
:name "Baz"}
{:id 4
:name "XXX"}]}
{:id 3
:name "Baz"}]}
{:id 5
:name "YYY"
:children [{:id 4
:name "XXX"}
{:id 2
:name "Bar"
:children [{:id 3
:name "Baz"}
{:id 4
:name "XXX"}]}]}]) =>
[["Foo"]
["Foo" "Bar"]
["Foo" "Bar" "Baz"]
["Foo" "Bar" "XXX"]
["Foo" "Baz"]
["YYY"]
["YYY" "XXX"]
["YYY" "Bar"]
["YYY" "Bar" "Baz"]
["YYY" "Bar" "XXX"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment