you are trying to access element at index 10. But actually, the element with the highest index is 9.
The length of the array is 10 (base count is 1). The highest index is 9 (base count is 0).
...