Invalid test case for Longest Absolute File Path


  • 0
    F

    Is that a valid input?
    "dir\n file.txt"

    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?


  • 0

    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?


  • 0
    P

    @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).


  • 0

    @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?


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.