I need some help with a C++ arrays task.
2. Lights
The park is illuminated by n (1 <100) lights.="" each="" of="" them="" shines="" all="" night="" or="" not.="" of="" course,="" which="" lights="" were="" on="" the="" first="" night="" and="" which="" were="" not.="" every="" other="" night="" the="" condition="" of="" the="" lamps="" shall="" be="" determined="" by="" the="" following="">100)>
the lamp will not illuminate if both of its neighbors were lit last night;
the lamp shall illuminate if one of its neighbors was illuminated last night and the other was not;
if neither of the first two rules applies to the lamp, it will illuminate when the night is even and will not illuminate when the night is odd.
Make a program to determine which lights are on and which will not be lit when k (1 <100) nights="" have="" elapsed,="" and="" to="" find="" which="" night="" the="" most="" lights="" were="" lit="" and="" which="" the="" least.="" if="" there="" are="" several="" identical="" nights="" with="" the="" most="" or="" least="" lights="" lit,="" the="" night="" with="" the="" lower="" number="" must="" be="">100)>
The first line of the original data file contains two integers: the number of lights n and the number of nights k. The second line contains a sequence of zeros and units separated by a space. This is the state of each lamp: a unit means that the lamp was lit on the first night, and zero means that it was not lit.
Extracted text: INITIAL DATA RESULTS EXPLANATIONS 1 10 101 FIRST NIGHT 6 2 0 10111 0 10111 110 10 1 THE NIGHT WHICH SECOND NIGHT SHINED MOST : THE NIGHT WHICH SHINED LEAST 1 9 5 0 1111010 1 0 10 100 0 0 0 01 111010 1 1ST NIGHT 1 100 10 10 1 2ND 01110 00 0 0 3RD 1 1011 1111 4TH 010 100 0 0 0 5TH THE NIGHT WHICH SHINED MOST THE NIGHT WHICH SHINED LEAST