I tried searching for this, but ran into threads about
sort. Now I don't necessarily think this is mutually exclusive of sorting, but at the moment I'm at a loss of how to approach this.
I have a Two-Dimensional Array:
Code:
{ 1, 2, 3, 4, 5, 6, 7 },
{ 0, 2, 3, 4, 5, 6, 7 },
{ 0, 1, 3, 4, 5, 6, 7 },
{ 0, 1, 2, 4, 5, 6, 7 },
{ 0, 1, 2, 3, 5, 6, 7 },
{ 0, 1, 2, 3, 4, 6, 7 },
{ 0, 1, 2, 3, 4, 5, 7 },
{ 0, 1, 2, 3, 4, 5, 6 }
I want to remove all 5's and the row that doesn't have any 5's. I was thinking that I would have to sort the array so that 5 was the last item in each array and then
shorten the array. Then I would have to sort the arrays so that the 6th row was the last row and shorten that. Is this the best way to go about doing this?
Code:
{ 1, 2, 3, 4, 6, 7, 5 },
{ 0, 2, 3, 4, 6, 7, 5 },
{ 0, 1, 3, 4, 6, 7, 5 },
{ 0, 1, 2, 4, 6, 7, 5 },
{ 0, 1, 2, 3, 6, 7, 5 },
{ 0, 1, 2, 3, 4, 6, 7 },
{ 0, 1, 2, 3, 4, 7, 5 },
{ 0, 1, 2, 3, 4, 6, 5 }
// then
{ 1, 2, 3, 4, 6, 7, 5 },
{ 0, 2, 3, 4, 6, 7, 5 },
{ 0, 1, 3, 4, 6, 7, 5 },
{ 0, 1, 2, 4, 6, 7, 5 },
{ 0, 1, 2, 3, 6, 7, 5 },
{ 0, 1, 2, 3, 4, 7, 5 },
{ 0, 1, 2, 3, 4, 6, 5 },
{ 0, 1, 2, 3, 4, 6, 7 }
// then
{ 1, 2, 3, 4, 6, 7 },
{ 0, 2, 3, 4, 6, 7 },
{ 0, 1, 3, 4, 6, 7 },
{ 0, 1, 2, 4, 6, 7 },
{ 0, 1, 2, 3, 6, 7 },
{ 0, 1, 2, 3, 4, 7 },
{ 0, 1, 2, 3, 4, 6 }