A simple programming exercise solution done in hrs.