I recently came across this interview question, Matrix largest product of n numbers in a row
I understood the rolling multiplication approach. I wanted to know if there would be any further optimization possible if I bounded the problem making it compulsory to select the entire row, column or diagonal.
So basically the question now becomes, Given an NxM matrix, find the row or column or diagonal with the largest product.
Is there an O(log n) algorithm possible?