Access elements in an array that are not contiguous

yeah that’s exactly the expected output