1 1 5 7 5
6 3 0 4 0
6 9 0 4 0
8 4 3 3 1
8 2 8 8 0
7 8 6 4 4
7 6 4 4 0
9 4 2 4 0
void something(vector < vector <int> > v)
{
sort(v.begin(), v.end());
int uniqueCount = std::unique(v.begin(), v.end()) - v.begin();
count = uniqueCount-1;
}
I want to count the different number except 0. In this case is 1 3 4 5 = 4 unique numbers. I don't quite get the correct answer and it's attempting to delete a few lines of the matrix.