[Community puzzle] Advanced Tree



You were right! I forgot to remove dot in hidden file name and sorting was wrong..

Thanks a lot!


I have modified the Multiple Flags Test to highlight when the sorting logic is incorrect. Hopefully this will prevent confusion in the future. Thanks for your help in identifying this issue.

  • danBhentschel


I do not understand the difference between test case 3 and test case 13. Why should the output be an error, instead of the following?

|-- File5
`-- .File8
0 directories, 2 files

Should I assume that, for input line 1 "string S - a path to execute tree in", S always refers to "./" plus S if S does not begin with "./"?

Not sure if the answer to the above has anything to do with the puzzle statement: "You're only given valid paths, which are only starting with one "current directory" (./) and without "parent directory" (../)"? But I have no idea what "without parent directory" means >.< Sorry if my question sounds stupid.

Thank you.



I agree, this is a bit ambiguous, especially if you don't have a priori knowledge of how Unix-like filesystems work.

  • danBhentschel


OK, thanks for your reply!


Any hindsight on Validator 12? I pass every IDE TC and every submit TC except this one.


Nevermind I found my issue, I wasn’t treating correctly the depth when the start directory was different than ‘.’ :slight_smile:


Feel free to suggest a new test/validator pair to help others debug that!


Any case where the starting directory is not ‘.’ and there’s a depth flag set will do, this TC is not covered in the IDE if I’m not mistaken :slight_smile:


No, seriously, I solved this way too long to be in any kind of mood nearing reading the statement fully. Especially that one, from my memory of it.

You’re still in it, you’re at your best! Write two similar test cases, put the slightly harder one here and PM me the slightly easier one, and everybody benefits!


So I made 2 TC like you asked. Turns out by doing them I found another bug in my code that wasn’t showed through any of the TC (IDE or submit).
Here’s a complex test:
Input =>

-a,-L 4

Output =>

|-- Directory7
|   |-- .File16
|   |-- .File17
|   |-- File18
|   `-- File19
|-- Directory8
|   |-- Fileb
|   `-- Filec
`-- Directory9
    `-- Directory10
        `-- Directory11
            |-- Directory12
            `-- Filef
6 directories, 7 files

I pmed you the other one.



The interface wouldn’t let me do without deciding for a difficulty level, so I put Medium for lack of a better inspiration. Feedback and counterproposals welcome.