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
Which company were you being interviewed for?
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.
very nice explained, appreciated!!!
shouldn't we do cur = 0 in the c="(" loop, to calculate what's in the brackets? I tried that and it still works...
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 🙏
You could have a digit made out of multiple characters. So that takes care of the entire digit.
The recursive solutions in the discussion are so hard to understand -___-
Is this your first time seeing the problem?
there's no chance
I don't believe someone could solve it so accurately and efficiently in the fry try
Well explained!
Master!
great explanation !!!
do not trust me rofl!