Search
⌘K

Leetcode 2245. Maximum Trailing Zeros in a Cornered Path

Find a path in an m×n grid with at most one turn whose cell-product has the maximum number of trailing zeros. Reduce each cell to counts of factors 2 and 5, build row/column prefix sums, and evaluate all four corner orientations at every cell to maximize min(total_twos, total_fives).


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.