one strange thing is happening, I have implemented this question using TreeMap and I think this will work. When I submit my code, it says wrong answer for the below testcase, however, when i run the same testcase in custom testcase, It says Corrrect answer.
Input:
["FileSystem","ls","mkdir","addContentToFile","ls","readContentFromFile","addContentToFile","readContentFromFile","addContentToFile","ls","readContentFromFile"]
[[],["/"],["/a/b/c"],["/a/b/c/d","hello world"],["/"],["/a/b/c/d"],["/a/b/c/d"," hello hello world"],["/a/b/c/d"],["/a/b/c/dddd","winstons"],["/a/b/c"],["/a/b/c/dddd"]]
My Output:
[null,[],null,null,["a"],"hello world",null,"hello world hello hello world",null,["d","dddd"],"winstons"]
Expected Output:
[null,[],null,null,["a"],"hello world",null,"hello world hello hello world",null,["d","dddd"],""]
Is anyone else facing the same issue?