# Challenge \#17: π The Christmas lights panel EASY At the North Pole, theyβve set up a **panel of Christmas lights** πβ¨ to decorate the workshop. Each light can be on with a color, or off. The panel is represented as a **matrix** where each cell can be: - `'.'` β light off - `'R'` β red light - `'G'` β green light The elves want to know if there is a **line of 4 lights of the same color** that are on and **aligned** on the panel (only horizontal β or vertical β). Lights that are off (`'.'`) donβt count. ```javascript hasFourLights([\ ['.', '.', '.', '.', '.'],\ ['R', 'R', 'R', 'R', '.'],\ ['G', 'G', '.', '.', '.']\ ]) // true β there are 4 red lights horizontally hasFourLights([\ ['.', 'G', '.', '.'],\ ['.', 'G', '.', '.'],\ ['.', 'G', '.', '.'],\ ['.', 'G', '.', '.']\ ]) // true β there are 4 green lights vertically hasFourLights([\ ['R', 'G', 'R'],\ ['G', 'R', 'G'],\ ['G', 'R', 'G']\ ]) // false β there are no 4 lights of the same color in a row ``` **Note:** The board can be any size. No diagonals.
Your battle is waiting in the queue. It will start automatically when a slot becomes available.