Implemented programming question of the Week 4