Desquared interview question

Data process with function including arrays