I have this matrix and I want to find a algorithm that can find all values = 1 and give give me the count of how many there are.
My matrix look like this and have the size n x n:
44444444
4 4 1 4
4 4 444
4444 44
4 1 34
444 444
44 44
44444444
Right now I don't know what kind of algorithm I have to use.