I am solving the problem. "List all triangles with a perimeter of 15, with no repeating triangles(get rid of all permutations, basically). I have successfully stored all the triangles in a vector and using nested vectors, each has a vector of the sides. My problem now is sorting both the vectors inside the triangle vector that contains the sides, and then afterward I need to sort the vector of triangles so that if I had:
[4, 5, 6]
[3 6, 6]
[4, 4, 4]
[3, 5, 7]
if would sort by the first column, then the second, then the third so that it would turn into:
[3, 5, 7]
[3, 6, 6]
[4, 4, 4]
[4, 5, 6]
Any idea on how to do this? Here is my code so far.
[Edit: By the way, when you present code that won't compile because it is erroneous, please state that that is the case and present the error you receive when you try to compile it.]
I googled extensively, and yes I came upon that, but I wasn't able to come up with a solution because I didn't quite understand it. I can sort a vector; I am having trouble with sorting the nested vector.
I intended to remove the erroneous line, but I left it there by mistake. I fixed it.