You are given a rectangular grid with dimensions MxN. Your task is to fill this grid with a specific pattern using backtracking. The grid is represented as a 2D array, where each cell can have a value of 0 (empty) or 1 (filled). Implement a function to determine the total number of unique patterns that can be generated.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak