Imagine you're a digital artist working with a beautiful equilateral triangle canvas made up of smaller triangular tiles. Your goal is to create a "viral coloring effect" where red color spreads automatically across the entire triangle!
The Setup: You have an equilateral triangle of side length n, divided into nยฒ unit triangular tiles. The triangle has n rows, where row i contains 2i - 1 triangles, indexed as (i, 1) to (i, 2i - 1).
The Magic Rule: Once you initially color k triangles red, an automatic spreading algorithm runs:
๐ Find any white triangle that has at least 2 red neighbors
๐จ Color it red
๐ Repeat until no more triangles can be colored
Your Mission: Find the minimum number of triangles to color initially so that the spreading algorithm eventually colors the entire triangle red. Return the coordinates of these initial triangles.
Note: Two triangles are neighbors if they share a side. For example, (1,1) and (2,2) are neighbors, but (2,2) and (3,3) are not.