mat(arr) actually creates a copy of the 2d arr vector but I want to use the same vector passed in the constructor in any operations of the object. You see mat doesn't make change to the original 2d vector.
Pointer arithmetic on 2d vector was buggy. Not able to find a solution.
I don't want to alter the sort criterion. I'm facing a TLE error on the very last few test cases. Hence I wanted to see if I can minimize the time of the prog by eliminating time spent in copying the 2d vector values.
And sorry i didn't get Make Comparator::mat a reference ?