Feedback: Notation Confusion in Problem Statement
The problem statement uses the same variable name i for two different purposes:
-
The index chosen for performing an operation:
Choose an index i (1 ≤ i ≤ N) -
The dummy variable used in the adjacency constraint:
A[i] ≠ A[i+1] for all 1 ≤ i < N
This can mislead readers into thinking the adjacency rule depends on the same i chosen for the operation, which is not the case. The second i is only a dummy loop variable.
To avoid confusion, the statement should use distinct variable names, for example:
-
Use
kfor the chosen index:Choose an index k (1 ≤ k ≤ N) -
Use
jfor the adjacency rule:A[j] ≠ A[j+1] for all 1 ≤ j < N
This small change improves readability and prevents misinterpretation.