Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Sort the folders lexicographically.
Insert the current element in an array and then loop until we get rid of all of their subfolders, repeat this until no element is left.