COMP360 Problem Set 4 Solution