Leetcode - Basic Calculator (Python)

Sdílet
Vložit
  • čas přidán 11. 09. 2021
  • September 2021 Leetcode Challenge
    Leetcode - Basic Calculator #224
    Difficulty: Hard
  • Věda a technologie

Komentáře • 16

  • @yang5843
    @yang5843 Před 2 lety +18

    How does every other youtuber spend 20 minutes badly explaining their process yet this guy elegantly explains the problem in 7 minutes ?

  • @thetiltfactory1760
    @thetiltfactory1760 Před 2 lety +5

    I was asked this problem in a FAANG company in November and wish should've come across your channel earlier

  • @thechinweibegbu
    @thechinweibegbu Před 25 dny

    After trying to solve this at timestamp 48:12:91, only having passed 8 test cases out of 46, seeing this straightforward approach and really intuitive code is discouraging me, I cannot lie. I have to keep going, I know, but sometimes I wonder if I am simply incapable of solving some questions. I would like to think that is not the case.

  • @derrickxu7784
    @derrickxu7784 Před 2 lety

    great explanation !!!

  • @sardines4dinner
    @sardines4dinner Před rokem

    shouldn't we do cur = 0 in the c="(" loop, to calculate what's in the brackets? I tried that and it still works...

  • @ravulaakhilsurya8569
    @ravulaakhilsurya8569 Před 2 lety +1

    You are hero ☺️

  • @anjaliyadav9360
    @anjaliyadav9360 Před rokem

    Well explained!

  • @chaengsaltz829
    @chaengsaltz829 Před 2 lety

    Master!

  • @winekills
    @winekills Před 6 měsíci

    i think you just saved me

  • @janmichaelaustria620
    @janmichaelaustria620 Před 2 lety +1

    The recursive solutions in the discussion are so hard to understand -___-

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

    I was wondering why cur * 10?

    • @sardines4dinner
      @sardines4dinner Před rokem +6

      e.g. for 123, the code would see 1 first, then when it sees 2, it would do 1X10 + 2 = 12, and then when it sees 3 it would do 12*10 +3 = 123. It just moves the first number by a tenth place each time. of course if an operator or bracket appears, it resets.

    • @hugurs2396
      @hugurs2396 Před 7 měsíci

      @@sardines4dinnerthank u brub 🙏

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

    Is this your first time seeing the problem?

    • @gomzomz
      @gomzomz Před 2 lety +8

      there's no chance

  • @akmaurya07
    @akmaurya07 Před rokem

    do not trust me rofl!