Find the last element in an array by selecting only even indexed elements
Suppose there is a given array of n elements, I want to select only even indexed elements until the array is left with only one element Like (1, 2, 3, 4, 5, 6)-> (2, 4, 6)-> (4)
Aucun commentaire:
Enregistrer un commentaire