Solution to assigment