On this site: https://codegolf.stackexchange.com/questions/246845/convert-json-object-of-directories-to-list-of-paths
There is an interesting perl solution but I'm trying to wrap my head around it and am baffled.
map/}/?/{/&&say($s)..$s=~s|[^/]+/$||:($s.=s/"//gr."/"),/{?}|".+?"/g When I do a simple test: my $s = <some json string> .. the map above I don't get any output. Thanks in advance
submitted by /u/UnicodeConfusion
[link] [comments]
Convert JSON object of directories to list of paths
Task The input consists of a JSON object, where every value is an object (eventually empty), representing a directory structure. The output must be a list of the corresponding root-to-leaf paths.Code Golf Stack Exchange