in problem d , jongmah , the editorial is dealing with types of at most 2 consecutive elements like i , i+1 , i+2 .
but where are the triplets which are in the form of i , i , i . how to deal with them . since we are not dealing with same triplets how it will give to correct answer , i couldn't understood the author's approach , can anyone elaborate it .