it does not clear tell us '\n' means root while '\t' means entering subfolder
Yeah, might be better to state something like that explicitly. On the other hand, I think the examples makes that pretty clear. And the examples don't contain even a single space character. So one must wonder why people add extra code to special-treat space characters when they have absolutely no reason to do so.
@XORNOTXOR I have one question: What if the level of filepath exceeds 200? You are using hard-coded 200 as the level vector's size. Is there a reason to choose this number or it's just a random number?
@vishal51 I agree. This is one of the stupidest test cases. For example: input: "dir\n........file.txt" (sorry markdown doesn't allow multiple spaces so each dot is a space), is supposedly meant to test whether we handle having spaces in the filename because the expected output is 16, not 12. Only four of the 8 spaces in the second line are meant to indicate that file.txt is a child of dir and the rest is meant to have filename "....file.txt". Seriously?
Looks like it's been fixed, if you open the Custom Testcase, it's formatted properly. However, as pointed out in this post, some of the actual test cases have 4 spaces instead of tabs. Is it an edge case that was missed, or is the problem not stated fully?