Algo Problem 1 a and b solved