BackmediumBacktracking Swiggy

Rectangular Pattern Painter Solution

Problem Statement

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.

Constraints

  • M and N will be positive integers between 1 and 100 (inclusive).
  • The input will be a string of B, W, and G characters, representing the sequence of colors.
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free