added solution for week 2, problems 1 and 2