Need help on the question QABC of Snackdown

I need help on how to start the operation on any location of array. Just a hint would work.

You are not supposed to ask any sort of questions/hints about a problem from an on-going contest

//