Given an array and a number, update the third element of the array to the given number. Mutate the array.
// input: const a = [1, 2, 3, 4, 5], n = 10 // output: [1, 2, 10, 4, 5]
/* output */