Solve the Programming Question of algo-0005 in coursera. Written in C++