Flipkart Paint Warehouse Houses
Flipkart Paint Warehouse Houses
EasyDynamic Programming100% accepted
Flipkart has n warehouses to paint with 3 colors (red, blue, green). No two adjacent warehouses can have the same color. Cost matrix cost[i][j] = cost to paint house i with color j. Find minimum total cost.
Approach
Paint n houses with 3 colors, no two adjacent same color, minimum cost.
Input
3
17 2 17
16 16 5
14 3 19
Output
10
More Dynamic Programming problems
Browse all coding problems →solution.py
Loading editor...
Test 1
Test 2
Test 3
Press Run to test your custom input, or Submit to judge against all test cases.
Sign in to continue
Create a free account to run code, submit solutions and track progress.
- Free forever — no credit card
- 10+ languages with live execution
- Points, streaks & leaderboards