Leetcode - Basic Calculator (Python)

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • September 2021 Leetcode Challenge
    Leetcode - Basic Calculator #224
    Difficulty: Hard

КОМЕНТАРІ • 16

  • @yang5843
    @yang5843 2 роки тому +21

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

  • @thetiltfactory1760
    @thetiltfactory1760 2 роки тому +5

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

  • @thechinweibegbu
    @thechinweibegbu 2 місяці тому

    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.

  • @SeattlePiPiPi
    @SeattlePiPiPi 2 роки тому +3

    I was wondering why cur * 10?

    • @sardines4dinner
      @sardines4dinner Рік тому +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 8 місяців тому

      @@sardines4dinnerthank u brub 🙏

  • @chrisrectenwald7307
    @chrisrectenwald7307 2 роки тому +3

    Is this your first time seeing the problem?

    • @gomzomz
      @gomzomz 2 роки тому +11

      there's no chance

  • @janmichaelaustria620
    @janmichaelaustria620 3 роки тому +1

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

  • @sardines4dinner
    @sardines4dinner Рік тому

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

  • @anjaliyadav9360
    @anjaliyadav9360 Рік тому +1

    Well explained!

  • @winekills
    @winekills 8 місяців тому

    i think you just saved me

  • @ravulaakhilsurya8569
    @ravulaakhilsurya8569 3 роки тому +1

    You are hero ☺️

  • @derrickxu7784
    @derrickxu7784 2 роки тому

    great explanation !!!

  • @chaengsaltz829
    @chaengsaltz829 2 роки тому

    Master!

  • @akmaurya07
    @akmaurya07 Рік тому

    do not trust me rofl!