Is that a valid input?
I don't think so.
the file should "below" at lease 1 folder. So "dir\n\t file.txt" would be a valid test case.
Anybody agree with me?
That test case is fine.
Where exactly do you think the "dir" folder is? I guess you think it's in the root folder? Then why do you mind a file also being in the root folder?
@StefanPochmann If file.txt is in an unnamed root folder, then the max file path length would be 8 (the length of "file.txt"), not 16 (which is the expected output).
@PsylentKnight No, it's more than 8 because of the space character(s) before the 'f' that you apparently for some reason ignore. No idea how you get 16, though. What string did you test and on what programming language?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.