there m x n matrix initialize 0s there 2D array indice indicesi ri ci represent 0indexed location perform increment operation matrixfor location indicesi followingincrement cell row riincrement cell column ciGiven m n index return number oddvalue cell matrix apply increment location indice Example 1input m 2 n 3 index 0111output 6explanation initial matrix 000000after apply increment 121010the final matrix 131131 contain 6 odd numbersExample 2Input m 2 n 2 index 1100output 0explanation final matrix 2222 there odd number final matrix Constraints1 m n 501 indiceslength 1000 ri m0 ci n Follow could solve on m indiceslength time on m extra space