BackmediumBacktracking Atlassian

Adjacent Color Configuration Solution

Problem Statement

Given a grid of size m x n, assign colors to each cell such that no two adjacent cells have the same color. The grid is represented as a 2D array of integers, where each integer corresponds to a cell. Your task is to determine the number of possible configurations.

Constraints

  • Grid size n is between 2 and 10 (inclusive)
  • Grid size n is even
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