title: What exactly does ++array[s.charAt(i) - 'A'] do?
body: <pre><code>for (int i = 0; i &lt; s.length(); ++i) 
      {
          if (s.charAt(i) &gt;= 'A' &amp;&amp; s.charAt(i) &lt;= 'Z') 
          {
              ++array[s.charAt(i) - 'A'];
          }
      }
  </code></pre>
  
  <p>I understand the For loop. the s.length() is 26, int[26] to be exact. so this loop will occur 26 times, 0-25. If the Char at i, 0-25 is between or are A-Z it will then proceed to <code>++array[s.charAt(i) - 'A'];</code> From what i see it adds array once per loop, or adds the value of array once per loop, for the String at char i so the first one would be 0 second would be 2,  because arrays start at 0. so adding an array at location of <code>i -'A'</code> is where i get confused.</p>