![Count the number of unique rows in a matrix](https://blogs.sas.com/content/iml/files/2013/06/countuniqrows.png)
How do you count the number of unique rows in a matrix? The simplest algorithm is to sort the data and then iterate down the rows, comparing each row with the previous row. However, this algorithm has two shortcomings: it physically sorts the data (which means that the original locations