#537 Counting the Number of Image Fill Operations

Companies:
T-Bank
Themes:
AlgorithmsGraphsPractice

An image is given where every pixel is colored with a color represented by a natural number.

Count how many fill operations, like in Paint, are required to recolor the entire image with a new color.

Example:

1
Text
[1 1 1 2 1],
[1 2 1 2 1],
[1 1 1 3 1]
Answer: 5

Question review

Mentor
Answer as you would in a real interview. I’ll ask follow-up questions, then compare your answer with the reference answer and show your accuracy as a %.
Sign in to start the dialogue The mentor keeps the context of the current question and your previous messages.
Sign in