added solution to triangle problem