Sponsored
Use these hints if you're stuck. Try solving on your own first.
What if you think of a tree hierarchy for the files?.
A path is a node in the tree.
Use a hash table to store the valid paths along with their values.
Solve with full IDE support and test cases