The problem says to modify an array in such a way that entries are limited to appearing min(2, m) times whenever those entries appear m times in the initial unmodified array.
It also restricts the number of passes to one. My question is: Is a valid solution restricted to using no more than a single pointer? The solution I have in mind traverses the array once, but relies on two pointers at the same time to do so, both going left to right. Is this considered two passes or one?