added a solution to the triangle problem