Code for Ass1/Prob2