Solution for Triangle