Wrote code for Ass1 Problem1.