Company: Visa_29Aug
Difficulty: medium
Script Execution with Nested Loops and Overflow Detection Problem Description You have a script built in a simple programming language which performs operations on a variable y . Initially y is set to zero and y can hold values ranging from 0 to 2 32 - 1. The script features three types of commands: foreach m : Corresponds to a looping structure. The commands within this loop will be executed m times. terminate : Ends the loop initiated by the nearest preceding foreach m command. increment : Increases y by 1. Once all commands are executed, the script returns the resultant y . All foreach m structures are properly paired with a terminate , ensuring valid script formation. Importantly, foreach m may immediately precede terminate , and increment can be outside any loops. Be aware that repeated 'increment' actions might cause y to surpass its maximum allowable limit! Your task is to execute the script initiated with y = 0 and confirm whether the final value of y is valid or if an overflow