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.
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.
How does every other youtuber spend 20 minutes badly explaining their process yet this guy elegantly explains the problem in 7 minutes ?
I was asked this problem in a FAANG company in November and wish should've come across your channel earlier
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.
I was wondering why cur * 10?
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.
@@sardines4dinnerthank u brub 🙏
Is this your first time seeing the problem?
there's no chance
The recursive solutions in the discussion are so hard to understand -___-
shouldn't we do cur = 0 in the c="(" loop, to calculate what's in the brackets? I tried that and it still works...
Well explained!
i think you just saved me
You are hero ☺️
great explanation !!!
Master!
do not trust me rofl!