Question d’entretien chez Upstox

write a higher order for reduce function in swift