Search
⌘K

Leetcode 1444. Number of Ways of Cutting a Pizza

Count the number of ways to make k-1 axis-aligned cuts on a rows×cols grid of 'A' (apple) and '.' so that each of the k resulting pieces contains at least one apple, modulo 10^9+7. With rows,cols ≤50 and k ≤10 this is typically solved using DP over subgrids combined with prefix sums to quickly check valid cuts.


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.