Triangle exercise solution.