This code is of Daily LeetCode challenge of 24 October 2024 in java language.
Approach
Sort the folders: Sorting ensures that sub-folders will come immediately after their parent folder.
Traverse the sorted list: While traversing, we compare each folder with the previously added folder to determine whether it is a sub-folder or not. If it is not a sub-folder, we add it to the result list.
š Issue Reference:
day25 solution of 25 October 2024
Problem-1233. Remove Sub-Folders from the Filesystem
š Checklist:
I have placed my solution in the correct folder (solutions/day25/).
My code follows clean coding practices and is efficient.
I have added comments in my code to explain the approach.
I have updated the README.md for the specific day with a brief explanation of my solution.
I have tested the solution on LeetCode and it works correctly.
š§ Solution Details:
Language Used: Java
Time Complexity: O(n log n)
Space Complexity: O(n)
š Additional Notes :
I have created the code with the sample example in the main function.
š What does this PR do?
This code is of Daily LeetCode challenge of 24 October 2024 in java language.
Approach
š Issue Reference:
š Checklist:
solutions/day25/
).README.md
for the specific day with a brief explanation of my solution.š§ Solution Details:
š Additional Notes :
I have created the code with the sample example in the main function.