Paint a Grid with Three Colors
Updated
Problem statement
Color an m by n grid with three labeled colors so that every pair of cells sharing an edge has different colors. Diagonal equality is allowed. Return the count modulo 1000000007.
Function
paintGrid(m: int, n: int) → intExamples
Example 1
m = 1n = 1return = 3The one cell may use any color.
Example 2
m = 2n = 2return = 18Every horizontal and vertical edge must connect different colors.
Constraints
- The author-linked task gives 1 <= m <= 5 and 1 <= n <= 1000.
More Intuit Online Assessment questions
- Employee Promotion OpportunitiesOA · Seen Oct 2026
- Next Pascal Row CoefficientOA · Seen Oct 2026
- Parse Router LogsOA · Seen Oct 2026
- Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
- Maximum Square-Free DivisorOA · Seen Oct 2026
- Two Tribes from Taller-Person CountsOA · Seen Oct 2026
- Shortest Path from an Encoded GraphOA · Seen Sep 2026
- Oldest and Youngest EmployeesOA · Seen Sep 2026
- Pressure-Isolation Shutdown OrderOA · Seen Sep 2026
- Submask Sum QueriesOA · Seen Sep 2026
Similar questions at other companies
- Count Routes Through Four Shop TypesOpenAI · OAOpenAI interview questions
- Vehicle Builds for Required Terrain (Game Adaptation)Roblox · OARoblox interview questions
- Minimum Moves to Spread Stones Across a GridAmerican Express · OAAmerican Express interview questions
- Maximum Profit Under a Bitwise OR LimitConcentric AI · OAConcentric AI interview questions
- Bitwise XOR SubsequencesJP Morgan Chase · OAJP Morgan Chase interview questions
- Beautiful Number OrderingsDocuSign · OADocuSign interview questions
- Minimum Operations To Reduce To ZeroUber · OAUber interview questions
- Bitwise XOR SubsequencesGoldman Sachs · OAGoldman Sachs interview questions
- Delete K Subsets for Maximum ScoreRubrik · OARubrik interview questions
- Optimize Discount Selection Under a Point BudgetPalantir · OAPalantir interview questions