Need help with this question | Array Transform

Hi guys, I came across this question and could not find the logic for this question. It would be a great help if someone can help with its logic.

Here is the link of the question: Array transform

Thanks!