SarthakKeshari / CPP-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
46 stars 132 forks source link

Solution of Delete Duplicate folders in system #489

Closed Rajat-Jain29 closed 2 years ago

Rajat-Jain29 commented 2 years ago

Choose your form and fill it -

1. Form 1(C++ Solution contributors)

2. Form 2(C++ Documentation Contributors)


1) Form 1

Issue Id you have worked upon -

482

Briefly explain your program logic -

There are 3 major steps: Build Trie tree Subtree serialization & Hash Generate remaining paths

There are several tricky parts that are easy to make mistakes:

Trie is a bit different from binary trees, it can be imagined as node.val is stored in its children's keys.. Need to sort path before insert into trie, since we don't need to differentiate the order of its branches

Screenshots(Attach 2 screenshots of your own input and output) -

Screenshot (291)

Screenshot (292)

Screenshot (295)

Screenshot (296)


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -


2) Form 2

Issue Id you have worked upon -


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your Pull Request for merging -

Rajat-Jain29 commented 2 years ago

@SarthakKeshari Kindly merge this PR. :)

SarthakKeshari commented 2 years ago

@Rajat-Jain29, Kindly attach the screenshot of the output that your written code produces.

Rajat-Jain29 commented 2 years ago

@SarthakKeshari Check again I have added the output of my code.

SarthakKeshari commented 2 years ago

@Rajat-Jain29, Kindly comment your code well.

@Rajat-Jain29, Kindly do this also

Rajat-Jain29 commented 2 years ago

@SarthakKeshari Now checked. I have done some changes.