You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# T: O(k*r*c*(m+n)) where k is the number of cuts, r and c are the number of rows and columns in the pizza, and m and n are the number of rows and columns in the preSum array.
# S: O(k*r*c) where k is the number of cuts, and r and c are the number of rows and columns in the pizza.
class Solution:
def ways(self, pizza: List[str], K: int) -> int:
m, n, MOD = len(pizza), len(pizza[0]), 10 ** 9 + 7