POTD- 04/07/2024 | Duplicate Subtrees | Problem of the Day | GeeksforGeeks

Sdílet
Vložit
  • čas přidán 20. 07. 2024
  • POTD: www.geeksforgeeks.org/problem...
    Code: discuss.geeksforgeeks.org/com...
    Timestamp:
    00:00 - Explanation
    00:36 - Approach
    04:46 - Code
    Connect with me :
    LinkedIn: / thepulkitmalhotra
    Twitter: / pulkitmalhotraa
    GitHub: github.com/PulkitMalhotra161001
    #coding #programming #GeeksforGeeks #ProblemofTheDay #CodingQuestions #POTD #problemsolving #practice #dsa #gfgpotd #gfg #dailychallenge #java #datastructures #algorithms #PulkitMalhotra

Komentáře • 1

  • @PulkitMalhotra
    @PulkitMalhotra  Před 17 dny +3

    You can apply preOrder, inOrder, or postOrder.
    In the Example TestCase1 Output is wrong It should be 2,4 only. No matter how many times duplicates subtree is there we have to consider only 1 time in our answer.
    In the example, 4 occured 3 times but we have to consider 1 time in duplicate and list.