Google Onsite Round for Bangalore - L4/L5
Anonymous User
2024

Hi Folks,

I got an interesting problem during my onsite round with Google. Any help to solve/approach is highly appreciated.

Question : Implement Flood-It game with K Steps.
Game Reference : https://unixpapa.com/floodit/

Problem Statement:
Let's assume you are given with a 2D Matrix, number of colors to use(C) and number of steps(K) to solve the problem.
2D matrix would contain values depending on the color (ex - 1 for Red, 2 for Yellow, 3 for Green, so on..).
Idea is to make the entire 2D matrix of one color within the given number of steps.

Return whether it is possible to solve the problem.
If yes, what are the order of colors clicked.

Note: This is my first ever post in Leetcode. If the question is still not clear, please head over to the game link provided above and try to play it or make a google search (Flood it game). You'll get the gist.

Comments (6)