Interesting problem, thank you for your video. There can be another follow up like put open and close brackets "()" to input to show None for the left node.
@TheSmashtenАй бұрын
Brilliant
@vivek.tiwary3 ай бұрын
What about the inner loop, it can go for n elements of the string ?
@translatingIdeasIntoCoding2 ай бұрын
why don't you just track the level? Increment level on "(", decrement level on ")", add number to result on numbers regarding to the level.