Garland

Garland

您将得到一个序列lights ,其中每个整数都是一个不同的灯光及其亮度。这个值决定了该灯光除了照亮自己的位置外,还能照亮左右多少个相邻位置。(因此,亮度为零的灯光只能照亮自己,而无法照亮相邻的位置)。

你的任务是打开尽可能少的灯,使整排灯的每个位置都至少被一盏灯照亮。由于灯光的最小工作子集并不一定是唯一的,因此您的函数应该只返回照亮整行所需的灯光数量。

You should be an authorized user in order to see the full description and start solving this mission.