array transform

what is the funtion of k in problem