Programming Assignment 2: Lexical Scoping

Submit the change made by using solve() function and adding comments to
individual sub function