Search
⌘K

Leetcode 1594. Maximum Non Negative Product in a Matrix

Find a right/down path from the top-left to bottom-right that maximizes the product of visited cells, returning the maximum non-negative product modulo 1e9+7 (or -1 if all products are negative). Because cells can be negative or zero, this is solved with DP that tracks both the maximum and minimum product at each cell to handle sign flips.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.