Goldman Sachs Interview - The Tree Question | Part II

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 มิ.ย. 2019
  • ✅New TH-cam Account - Developer Bhaiya 👉🏻bit.ly/developer-bhaiya-youtube Rachit, an ex-Software Engineer@Microsoft talks about his Software Interview Experience with Goldman Sachs.
    algoexpert.io/rachit
    Use "rachit" as coupon code to get 30% off.
    Tree Traversal Trick: • If you fear Tree Trave...
    Github Code: github.com/rachitiitr/DataStr...
    Github Code 2: github.com/rachitiitr/DataStr...
    Goldman Sachs - Part I: • Goldman Sachs Intervie...
    AlgoExpert has video solutions to 70 coding problems, covering all the important topics generally asked in Coding Interviews.
    I recommend AlgoExpert for Interview Prep + DailyCodingProblem.
    dailycodingproblem.com/rachit to get interview questions being asked in firms like Microsoft, Google and Amazon. It's FREE and super cheap if you want the solutions as well (totally worth it).
    Cracking Coding Interview in 3 Months: • How Beginners Can Crac...
    🔥 SUBSCRIBE AND HIT BELL ICON TO CHECK MORE OF MY CONTETNT 🔥
    th-cam.com/users/RachitJain?sub_con...
    / rachitjain2095
    / rachitiitr
    AlgorithmsWithRachitJain
    / rachitiitr
    ================
    Important Playlists:
    ================
    Check my channel for guided content.
    You can also check all playlists at / @rachitjain
    MyProgrammingBlog
    ===============
    Programming Blog ► rachitiitr.blogspot.com
    Github ► github.com/rachitiitr/DataStr...
    MyProgrammingProfiles:
    ===================
    CodeForces ► www.codeforces.com/profile/rac...
    CodeChef ► www.codechef.com/users/rachitiitr

ความคิดเห็น • 138

  • @RachitJain
    @RachitJain  5 ปีที่แล้ว +29

    All necessary links in video description. Hope this was fun to watch.

    • @kirubagaran3749
      @kirubagaran3749 5 ปีที่แล้ว +1

      thank you so much dude

    • @abhishektyagi4428
      @abhishektyagi4428 5 ปีที่แล้ว +1

      Sir Would Java be of less use in future because of growing use of Python in web dev, data science, ML, AI and
      Growing Use of KOTLIN, DART flutter in Android dev side? If it is not so plz do explain in detail the advantages of Java and it's uses in comparison to python

    • @PRIYANKAKUMARI-iz2no
      @PRIYANKAKUMARI-iz2no 5 ปีที่แล้ว

      Hey you have mentioned this question in your own video, data structure and algo, 29 Sep 2018 at 10:30.
      You are following ur own video😂😂😂

    • @amand143
      @amand143 4 ปีที่แล้ว +1

      Sir, gsoc vs research internship (for better resume for placements)????

    • @vamsikrishnapendyala4979
      @vamsikrishnapendyala4979 3 ปีที่แล้ว

      What about another solution where you store the values of the tree in a hashmap and reduce the problem to finding two numbers with target sum. Time complexity becomes O(n) -> 'n' corresponds to number of elements of one tree alone.

  • @tejassardana6266
    @tejassardana6266 5 ปีที่แล้ว +91

    your presentation skills have increased massively. kudos

  • @tusharsinha1772
    @tusharsinha1772 5 ปีที่แล้ว +38

    Please make a video on your interview experience at Tower Research. If I am not wrong, Tower Research asks a lot of system design and operating systems questions. It will be good to what exactly they asked you in the interviews.

  • @ankurvishwakarma7472
    @ankurvishwakarma7472 5 ปีที่แล้ว +11

    Love this video sir plz keep posting such question🤗

  • @mandavasairaghavendradines6582
    @mandavasairaghavendradines6582 5 ปีที่แล้ว +6

    Thankyou that's very informative keep going!!

  • @harish_jobsa471
    @harish_jobsa471 5 ปีที่แล้ว

    Awesome Work Rachit, Thanks!

  • @mahimsd7645
    @mahimsd7645 4 ปีที่แล้ว +1

    Really good work !!!
    Highly Appreciate ur work !!!!

  • @gopikrishna4480
    @gopikrishna4480 3 ปีที่แล้ว +1

    goosebumps !!!! when u just shifted the whole problem from bst to arrays 1 Awesome brother :) great motivation

  • @vinci_not_here
    @vinci_not_here 4 ปีที่แล้ว +2

    you deserve a like for this ingenious solution. Really Cool

  • @starlord9220
    @starlord9220 5 ปีที่แล้ว +1

    I hope i become a matured programmer like you someday 🤠, awesome video , thankx for sharing ur experience

  • @Sumit-mi7ys
    @Sumit-mi7ys 4 ปีที่แล้ว

    This is a beautiful solution rachit! Keep up the good work

  • @indraneelsarkar3452
    @indraneelsarkar3452 5 ปีที่แล้ว +46

    Rachit, you genius, I've been trying to figure out a generalized solution for iterative traversals for days now, and you just do it in minutes, that too in an interview -- god _/\_

  • @amangupta-el1gf
    @amangupta-el1gf 5 ปีที่แล้ว +8

    love this video sir,,could u make a video on how to become purple in cf.(strategy,practice,approach). that will be very helpful.thanks

  • @VEDANTAKRISHNABHUTANI-ds7zu
    @VEDANTAKRISHNABHUTANI-ds7zu 3 ปีที่แล้ว

    brilliant idea, rachit. I think you took inspiration from graph colouring in dfs. Amazing thought process.

  • @arihannnt
    @arihannnt 3 ปีที่แล้ว +1

    That iterative inorder traversal 🤩🤩🤩damn you really slayed

  • @raghuveernaraharisetti
    @raghuveernaraharisetti 5 ปีที่แล้ว +2

    ahh a version of two sum problem with binary search trees!!!👌

  • @nishantsinghraj7098
    @nishantsinghraj7098 5 ปีที่แล้ว +1

    Bhaiya, please make a video on, how interviewers sometimes try to trap the candidates and how constantly they keep giving hints to test our understanding and the boxes which we have to tick for the selection!

  • @ckdhakad
    @ckdhakad 4 ปีที่แล้ว

    you could also use unordered map for storing the inorder traversal values.

  • @nipulsindwani117
    @nipulsindwani117 5 ปีที่แล้ว

    The Video Quality is Increased
    Thank You Sir
    Please Can You make A Solution Video for this DP problem
    (Hoping for Help Editorial is not given at codeforces)

  • @abhishektyagi4428
    @abhishektyagi4428 5 ปีที่แล้ว +1

    Sir Could you please make a video explaining the resources you use to learn or enhance your skills about languages

  • @AbhishekKumar-yv6ih
    @AbhishekKumar-yv6ih 4 ปีที่แล้ว +1

    The space complexity is still O(n). The actual struggle is to make it O(logn) in case of balanced tree. It can be done using dfs+stack.

  • @karthikchennupati6177
    @karthikchennupati6177 4 ปีที่แล้ว +2

    There is an iterative version of Inorder Traversal without even using stack - "Morris Inorder Traversal"

  • @umapatikumarsinha9667
    @umapatikumarsinha9667 4 ปีที่แล้ว +1

    for problem 2nd , I think we can do this by hashmap with maximum time complexity of 2n(n=total element of smaller array)..
    please reply

  • @kaustubhpandey9654
    @kaustubhpandey9654 4 ปีที่แล้ว +9

    Can we do it this way?
    We can store all the nodes from the first tree in an unordered map. Then we simply go over the nodes of the second tree and see if sum-node exists in unordered map. This way it would take O(n+m) time complexity

    • @kaustubhpandey9654
      @kaustubhpandey9654 3 ปีที่แล้ว

      @Shivansh Sharma Yup, but for set insert or retrieval would take log(n). For unordered map it's O(1). Maybe we can use unordered set if it's there in stl

  • @forloveamit2007
    @forloveamit2007 2 ปีที่แล้ว

    thanks and congratulations 🥳

  • @nikhilangral5480
    @nikhilangral5480 5 ปีที่แล้ว

    Great work bhaiya!

  • @vaibhavahuja4001
    @vaibhavahuja4001 3 ปีที่แล้ว

    I think the reason they asked you to solve it iteratively, is because maybe they wanted you to implement something like an iterator for binary search tree. And then you would not need extra space. One forward iterator on left most node of first BST and one backward iterator on the right most node of the second BST. Then you could have used this two pointer technique for getting answer in O(1) space.

  • @user-mi8ew2to8e
    @user-mi8ew2to8e 3 ปีที่แล้ว +4

    I didn't know GS asks such easy questions

  • @The_Inquisitive_Boy
    @The_Inquisitive_Boy 4 ปีที่แล้ว +3

    Sir what was the package that you're offered?

  • @prasenjitgautam
    @prasenjitgautam 4 ปีที่แล้ว +1

    The number of views on this video can give a basic idea of the amount of competition out there! Whopping 35k!!

  • @ajourney179
    @ajourney179 4 ปีที่แล้ว

    rachit bhai , leetcode ke medium / hard problems par video banana agar time mile to. bahut learning milati hai usse.

  • @abhishektyagi4428
    @abhishektyagi4428 5 ปีที่แล้ว +4

    Sir Would Java be of less use in future because of growing use of Python in web dev, data science, ML, AI and
    Growing Use of KOTLIN, DART flutter in Android dev side? If it is not so plz do explain in detail the advantages of Java and it's uses in comparison to python

  • @Paradise-kv7fn
    @Paradise-kv7fn 5 ปีที่แล้ว

    Wouldn't storing all keys of 1 tree in a hashmap and then checking for target-x exists in the map(where x are the nodes in the other tree) be a better approach? The time comp would be the same as your method i.e O(m+n) but the space comp would be better(O(n) as opposed to O(m+n) in the inorder method)

  • @JSDev776
    @JSDev776 2 ปีที่แล้ว

    you could just use a hash of the smaller bst and check if 30-x exist in there, that will take less space and u get it done quicker.

  • @kartiknighania8588
    @kartiknighania8588 5 ปีที่แล้ว

    Please provide dp questions also..

  • @areebwadood6273
    @areebwadood6273 5 ปีที่แล้ว

    I too used the same approach

  • @ayushmishra8581
    @ayushmishra8581 4 ปีที่แล้ว +1

    Damn man!! 😎

  • @tusshar2000
    @tusshar2000 3 ปีที่แล้ว

    Hashmap could be used instead of two pointer method ?

  • @Whythis2628
    @Whythis2628 5 ปีที่แล้ว +2

    I was wondering , could not you use hashing with target-element , from the first tree and use to look up while traversing the second one ?

    • @rahulsangvikar7973
      @rahulsangvikar7973 4 ปีที่แล้ว

      Hashing doesn't always guarantee O(1) searching...worst case can be O(n) which makes overall worst case complexity O(n²)...two pointer technique guarantees overall O(n) complexity.

  • @cyberstud0074
    @cyberstud0074 4 ปีที่แล้ว

    Where GS makes use of BST ?
    I was thinking
    Arrays.sort both arrays and then try sum..

  • @gurharpartapdhaliwal3087
    @gurharpartapdhaliwal3087 4 ปีที่แล้ว

    get inorder if both and we ll get two sorted arrays and we can take two ptrs initially pointing to beginning of both arrays and accordingly to get the sum

  • @kushalvijay8056
    @kushalvijay8056 5 ปีที่แล้ว +2

    Did the interviewer gave you any hints during the course of time you were solving the problem?? Please do reply sir

  • @ayushsoni5578
    @ayushsoni5578 4 ปีที่แล้ว

    Hi brother, can you please tell from where did you learnt advance c++ programming including STL ?

  • @nshukla6
    @nshukla6 4 ปีที่แล้ว

    Can we use binary search as the array is sorted

  • @shankysays
    @shankysays 4 ปีที่แล้ว

    You could had done this also. Since height is the issue and we know it's a BST. We do inorder traversal and using this make AVL out of it. Doing Inorder is order of n and making AVL also in this case is order of n so total time complexity would had been o(n+m) + lg term. What do you think?

  • @FazeelUsmani
    @FazeelUsmani 5 ปีที่แล้ว

    Any tips to get our resume shortlisted for interviews for companies like Goldman Sachs or D.E. Shaw? I've not studied from any of the IITs or NITs but completed my Engineering from a normal EAMCET college. Does educational background matters to get our resume shortlisted?

  • @tirthjayswal9895
    @tirthjayswal9895 4 ปีที่แล้ว

    awsome

  • @seemajain55
    @seemajain55 3 ปีที่แล้ว

    Can we also do like in the first tree find the max value and min value
    _max = 30 - min from 1st tree
    _min = 30 - max from 1st tree
    In secondtree check root node with _min and _max.
    3 cases - both on left or right subtree
    One on left and other on right
    Then it's cake, I hope so....

  • @raghavkakar8092
    @raghavkakar8092 4 ปีที่แล้ว +1

    Recursion is just a game of function stack.
    So to convert from recursion to iteration, just understand how the working of a function stack, and implement a normal stack the same way using itertation.

    • @charan775
      @charan775 4 ปีที่แล้ว

      it's not everytime that easy to convert the recursion to iteration using stack. try to do tower of hanoi problem iteratively you'll understand

    • @raghavkakar8092
      @raghavkakar8092 4 ปีที่แล้ว

      @@charan775
      Yeah i absolutely know. Its very difficult to convert it but the basic behind the conversion lies on the function call stack. I just meant this.

    • @charan775
      @charan775 4 ปีที่แล้ว

      @@raghavkakar8092 yeah that's right.

  • @RandomPerson-hj8fq
    @RandomPerson-hj8fq 5 ปีที่แล้ว +4

    Sir what should be roadmap for me as i am in my summer vacations after 2nd year and i am not quite good in comp. programming and what should be my approach towards it.

    • @mridul1161
      @mridul1161 5 ปีที่แล้ว +1

      Do CP as much as possible follow gaurav's and rachit sir video,As well as try hand on some project's you won't get the free time again.Try to make notes specially for the approaches and data structure you use for solving problems, that really help me in my prep!!!

    • @Odin_Borson
      @Odin_Borson 4 ปีที่แล้ว +1

      one thing is Goldman asks heavily maths problems(gfg has a collection) and Probability is a must to be well versed with .

  • @siliconmessiah1745
    @siliconmessiah1745 4 ปีที่แล้ว

    I guess we could also simply the traverse the trees and store the values in two different hash sets. It would be easy from there on. Is that a good solution??

    • @charan775
      @charan775 4 ปีที่แล้ว

      complexity would be more though.
      O(N+M) for traversing the trees
      And then O(max(NlogM,MlogN)) for searching through hash sets.

  • @studgaming6160
    @studgaming6160 5 ปีที่แล้ว +1

    do you charge for personal interview/coaching ??

  • @samarthtandon2163
    @samarthtandon2163 5 ปีที่แล้ว +1

    It is simple wih hashing

  • @khukansaha5194
    @khukansaha5194 4 ปีที่แล้ว

    Hi Rachit. I am also an Electrical Engineer but from a state govt college and have no experience in programming other than the basics of python. Can I venture into the software engineer carrer? Is it worth it now p s. I already have a experience in FMCG sector

  • @agrawalsonali06
    @agrawalsonali06 3 ปีที่แล้ว

    What's wrong in 2 pointer technique...it's doing in O(M+N).??..any other technique in less than this time complexity?

  • @karthikmucheli7930
    @karthikmucheli7930 4 ปีที่แล้ว

    Is this problem there in leetcode premium?

  • @sameerkarode3676
    @sameerkarode3676 3 ปีที่แล้ว

    I find recursive solution to be very much simple rather than iterative approach !

  • @JagjeetSingh-gi7kv
    @JagjeetSingh-gi7kv 5 ปีที่แล้ว

    You make problems look easy.
    Appreciate your efforts that you put for us. Keep it up bro

  • @devbhatia7107
    @devbhatia7107 5 ปีที่แล้ว

    How do i get job at big product based companies , i'm not from any IIT, NIT, etc . I am from tier 5 college. How?

  • @somendraraj3034
    @somendraraj3034 5 ปีที่แล้ว

    Hey Rachit, its great you have cracked Goldman Sachs interview. Are you still want to apply to Goldman ?

  • @romokdas8494
    @romokdas8494 5 ปีที่แล้ว

    Can we use hashmap to find 30-x from the second bst?

    • @niranjanhegde1535
      @niranjanhegde1535 5 ปีที่แล้ว +1

      Yes I think we could use the hashmap or hashset. First, we had to create a hashset from one bst and then search for the value from other bst.
      Space complexity would be o(n)
      And time complexity would be o(m) or o(log m) or o(log n)

  • @dharmanshah1239
    @dharmanshah1239 5 ปีที่แล้ว +2

    Hey Rachit I want to add paid english captions for your videos.can we talk on FB? Or email??

  • @sktguha
    @sktguha 3 ปีที่แล้ว

    Instead of converting to array first, couldn't you just put two pointers at root of each tree and move first pointer left and the second pointer right and in next time move first pointer right and second pointer left looking for the target sum

  • @she.....
    @she..... 2 ปีที่แล้ว

    why not use a hashmap and traverse the first tree to store the 30-x in the hashmap/hashset and then start traversing the next tree

  • @apri502
    @apri502 3 ปีที่แล้ว +1

    Do engineering colleges teach all this to CS students ? I mean , I had never heard of 2 pointer technique before !

    • @RachitJain
      @RachitJain  3 ปีที่แล้ว +2

      I doubt they teach it, but what do I know I am from Electrical

    • @jk-sj4nf
      @jk-sj4nf 3 ปีที่แล้ว +1

      @@RachitJain Hello sir , since you r from electrical , does iit give practical knowledge for electrical engineering students or just it is like studying theoretically ? What practical knowledge we will get for electrical engineering in IIT ?

  • @saurabh8623
    @saurabh8623 5 ปีที่แล้ว

    can I apply to such companies and get selected , when I have no experience in IT industry , and already graduated from some xyz college in 2016.

    • @ojasthengadi9681
      @ojasthengadi9681 4 ปีที่แล้ว

      Ofcourse. you just need to crack these rounds

  • @anshulvairagade1604
    @anshulvairagade1604 4 ปีที่แล้ว +1

    Plz reply this query
    CAN WE SOLVE THIS ALGORITHM USING PYTHON?

    • @srivaishnav2319
      @srivaishnav2319 3 ปีที่แล้ว

      Any algorithm can be implemented in any programming language.

    • @arnabsom3251
      @arnabsom3251 3 ปีที่แล้ว

      Try doing it in brainfuck

  • @premangraithatha8273
    @premangraithatha8273 5 ปีที่แล้ว +1

    This question is on geeksforgeeks

  • @dineshkamdi3505
    @dineshkamdi3505 4 ปีที่แล้ว

    Tell me about any analytical que...that ask Goldman sach

  • @badalsinghrao8045
    @badalsinghrao8045 3 ปีที่แล้ว

    Please provided also in hindi.

  • @FazeelUsmani
    @FazeelUsmani 5 ปีที่แล้ว

    Is it really worth to purchase Algo expert thing? It's saying only 70 algorithms

    • @FazeelUsmani
      @FazeelUsmani 5 ปีที่แล้ว

      It's only $49 dollars after discount. Thanks for the coupon code Rachit

    • @charan775
      @charan775 4 ปีที่แล้ว

      now they are 75. they are basically base problems... base to any other problem

  • @rajeevsingh758
    @rajeevsingh758 5 ปีที่แล้ว +4

    I can solve first 2 to 3 problems in Codechef, sometimes only first 2. 😥

    • @sonulohani
      @sonulohani 5 ปีที่แล้ว +1

      Atleast you could solve 2 problems. You know what i mean...

  • @puskinmittal8956
    @puskinmittal8956 3 ปีที่แล้ว

    Ye pura question k saare method mujhe malum thee pr phir bhi I have no confidence in coding😅

  • @DHAiRYA2801
    @DHAiRYA2801 3 ปีที่แล้ว +3

    FYI
    Rachit is from Electrical and not CS background
    *Legend*. Which one do you prefer, Codewars or CodeChef?

    • @Rahul-oy4bp
      @Rahul-oy4bp 2 ปีที่แล้ว

      Why did he take Electrical engineering when he wants to be in CS.

  • @ItsHowdy
    @ItsHowdy 3 ปีที่แล้ว

    I have an interview with Goldman Sachs tomorrow and I don’t know how to do any of this 😃😁

  • @AdityaSharan811
    @AdityaSharan811 5 ปีที่แล้ว +1

    Rachit I used your promo code but when I go to the payment portal card gets declined I tried 2-3 cards more but problem pertained...then I contacted algoexpert via mail but they didn't responded .so If you could help ,then please convey them to add method like UPI,paytm would be helpful for indian customers to pay with ease!!

    • @RachitJain
      @RachitJain  5 ปีที่แล้ว +1

      I will look into this.

    • @AdityaSharan811
      @AdityaSharan811 5 ปีที่แล้ว

      Btw video was awesome the way you used iteration on tree ...quite helpful loved this video 👌

  • @abhishekgautam1063
    @abhishekgautam1063 5 ปีที่แล้ว

    Gaurav sen also publicizing this website 😂😂

  • @sathvikrijo
    @sathvikrijo 5 ปีที่แล้ว

    Rachit, I still didn't get you in two pointer technique. I knew that technique, but I think that will works only in one array. Let me give you some example case in which that your idea of two pointer approach fails. Let consider an array of [3,7] and [7,2] and the sum is 10. Your technique will fail, but there exists a pair

    • @RachitJain
      @RachitJain  5 ปีที่แล้ว +2

      The second array should be sorted as well. Its not compulsory that you got to use this technique on one array. In this case, I can safely apply two pointer technique.

    • @sathvikrijo
      @sathvikrijo 5 ปีที่แล้ว

      @@RachitJain I got you bro🤝💯🔥

  • @djBC10000
    @djBC10000 4 ปีที่แล้ว

    This question is super easy rofl, just use a hashtable to store one of the trees, and you will get O(N) runtime and O(N) space.

  • @simraj1219
    @simraj1219 3 ปีที่แล้ว +2

    How s=18 come. Please reply 😭😭

    • @balajias3065
      @balajias3065 3 ปีที่แล้ว

      S is input... whatever the s is we need to find two nodes that add up to S

  • @vikasvishwakarma5263
    @vikasvishwakarma5263 5 ปีที่แล้ว +1

    30-x from the unordered_set O(1) time

    • @aanandk2591
      @aanandk2591 5 ปีที่แล้ว

      So does it mean just O(N)? Vow

    • @charan775
      @charan775 4 ปีที่แล้ว

      do you mean unordered_map?

  • @tarushiarora8628
    @tarushiarora8628 4 ปีที่แล้ว

    Hey was it on campus or off campus?

    • @RachitJain
      @RachitJain  4 ปีที่แล้ว +1

      Off

    • @tarushiarora8628
      @tarushiarora8628 4 ปีที่แล้ว

      @@RachitJain and how do you find referrals ......like through friends or through random searching at LinkedIn for refferrrals / recruiters?

    • @RachitJain
      @RachitJain  4 ปีที่แล้ว +1

      @@tarushiarora8628 already have a video on my channel to talk about this

  • @PradeepSingh-ov3bt
    @PradeepSingh-ov3bt 5 ปีที่แล้ว +3

    What was the offer ?

    • @RandomPerson-hj8fq
      @RandomPerson-hj8fq 5 ปีที่แล้ว

      Really want to know that

    • @vatsalhirpara5869
      @vatsalhirpara5869 5 ปีที่แล้ว

      Goldman pays 22 lakes to freshers from our college. So with experience like Rachit it must be quite high.

    • @RachitJain
      @RachitJain  5 ปีที่แล้ว +7

      If they are paying in lakes, I am happy with just one.

    • @PradeepSingh-ov3bt
      @PradeepSingh-ov3bt 5 ปีที่แล้ว

      Sir can u make a video regarding questions asked on operating systems

    • @keshavlakhotia1432
      @keshavlakhotia1432 5 ปีที่แล้ว

      @@RachitJain Lol.

  • @harendrasingh_22
    @harendrasingh_22 4 ปีที่แล้ว

    2:15 yeah this was my first intuition.

  • @rajatmehta8499
    @rajatmehta8499 4 ปีที่แล้ว

    learn new technique two pointer. usualy i use hashmap to find sum of pair heheh

  • @VinodKumarBM
    @VinodKumarBM 4 ปีที่แล้ว

    When I tried to Buy the course in AlgoExpert it says only 15% discount. But you said in the video 30%. Can you please check once?

    • @RachitJain
      @RachitJain  4 ปีที่แล้ว

      No coupon exists for 30% anymore from 1st November. Last few of my videos do mentioned about it.

  • @harendrasingh_22
    @harendrasingh_22 4 ปีที่แล้ว

    4:04 oh !.

  • @manishrawat1079
    @manishrawat1079 5 ปีที่แล้ว

    what was that beautiful number you got.

  • @sneelakantan1
    @sneelakantan1 3 ปีที่แล้ว

    Don't go with Rachit's suggestion and buy AlgoExpert. It is total crap. I am sure he has been paid to advertise for it. I bought it and the problems are too simple and nowhere close to real interview problems.

  • @sayanghosh2883
    @sayanghosh2883 3 ปีที่แล้ว

    ANOTHER APPROACH:- Traverse the first tree and insert
    (target_sum - element) into a unordered_set and then traverse the 2nd tree and check if the element is in the set if it is then print it and (target_sum - element) and break.
    Time complexity - O(m+n)
    Extra space - O(min(m,n))