add the simplely use O(n^2) space cost solution to Triangle