But in your code, your index variable(i) starts from 1 and ends at 10(height.length). It leads to two issues, So you are missing first element (0th) in array, and trying to get 10th element (which is not present), and it throws Array Index Out Of Bounds Exception.Change your for loop so that it starts from zero, and ends at 9.
The problem in the first line of code is you are missing the first position (i = 0) of the array. Since every array starts at the 0 position so your last index cannot be equal the length of the array, but 1 index less, and this is why you are having the index out of bound error.