title: Index out of range error occurs even when the iterator is way far away from the min and max bounds of array
body: <p>Sorry everyone, may be a redundant question. But ,i am posting this question after straining my brain for like 4 hours of debugging and googling this issue on many stack overflow threads.</p>
  <p>As the terminal debugger shows:</p>
  <ul>
  <li>The sentences array size or count is 519554</li>
  <li>The error occurs exactly at the iterator count of 312891</li>
  <li>You can also see in the terminal, there is no issue accessing the
  indexes 312892 or 312891. The data is there. I am able to print them
  out. I cannot figure out my mistake    here. Please help me fix this..</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/kIDrF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kIDrF.png" alt="enter image description here" /></a></p>