My solution to Pythagorean Theorem Assignment 2