BASIC CALCULATOR III | LEETCODE # 772 | PYTHON SOLUTION

Sdílet
Vložit
  • čas přidán 10. 05. 2022
  • In this video we are solving an absolutely dreadful question: Basic Calculator III (Leetcode # 772).
    This question is quite terrible and very confusing to solve. The other basic calculators were manageable but this one is just extra and takes it to a whole other level. We can solve it in a very similar way but we still need to be careful here as there's some annoying cases we need to make note of now that we can have parenthesis and multiplication/divison.
  • Věda a technologie

Komentáře • 12

  • @ziyiyang4550
    @ziyiyang4550 Před 2 lety +2

    Great solution! It's the most clean one I've seen. Implementing DFS using stack is definitely a pain lol

  • @landocodes
    @landocodes Před 5 měsíci

    My Meta phone screen is tomorrow and I think I found a video for every Meta question I ran into (except for maybe 1 that I can't remember).. Just wanted to say thanks again for the hard work man. I'll be recommending this channel to everyone I see prepping for Meta and hopefully I'll pass to the onsite and get more utility out of it.

    • @crackfaang
      @crackfaang  Před 5 měsíci

      Thanks for the kind words and best of luck with the phone screen. I'm sure you'll smash it!

    • @landocodes
      @landocodes Před 5 měsíci

      Thanks man I passed!@@crackfaang Now it's time to check out your System Design playlist :)

    • @aman4434
      @aman4434 Před 5 měsíci

      how was it? Mine was supposed to be tomorrow and its now gotten rescheduled lol. I'm watching this channel too! But still nervous...

    • @landocodes
      @landocodes Před 5 měsíci

      @@aman4434it went well! I heard that I passed the next day.
      If you’ve done the top meta questions, and get a good interviewer, then it should be a breeze! Just make sure to communicate your ideas and have a good understanding of the solution you’ve chosen.

    • @landocodes
      @landocodes Před 5 měsíci

      It went well! I was a bit nervous for a second but my interviewer was amazing. She calmed me down and told me to just let my thoughts out. Once I did that I got back on track and everything went smoothly! Heard back the next morning that I passed!
      As long as you have the majority of the medium/easy top 100 meta questions complete then I'm sure you'll do fine! Good luck :)@@aman4434

  • @garimagupta4208
    @garimagupta4208 Před rokem

    great explanation

  • @amadoufall6237
    @amadoufall6237 Před 2 lety

    Good job on your videos. Could you please do this one next? 1267. Count Servers that Communicate. I would really appreciate to hear your explanations

    • @crackfaang
      @crackfaang  Před 2 lety +3

      Thanks for the kind words and your support. I’ll add that question to my work queue and make sure you subscribe so you don’t miss the upload

  • @davidoh6342
    @davidoh6342 Před rokem +1

    in line 34, if op=s[i], will it become ")" ???

    • @def__init
      @def__init Před rokem +3

      yes but it's fine because if the string still has more after ")", the following MUST be a new OP, like 2*(...)/3 from the examples. And when we process the "/" after, which will first call helper with op being ")", which will do nothing. Then business as usual, num back to 0 and op set to "/"