Adding solutions for the 3rd homework