What is purpose of weird test cases?


  • 12
    V

    I am not sure if testing code against "dir\n file.txt" will imply any intelligence. What is the purpose of such cases? Do they really occur in tab organized directory structure file? Dear problem setters, think about it OR please clarify me here. Thanks.


  • 2
    A

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


Log in to reply
 

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