Added ex 2 solution
ex 4 psuedocode