title: Comparing chars in String elements of an arraylist causing indexoutofboundsexception
body: <p>I am supposed to compare the characters in an arraylist(String) and then if all the Strings have common characters or character or no common character, i have to display the number of common characters in all the strings of an arraylist.
  Here is my function:</p>
  
  <pre><code>public void theElementor(ArrayList&lt;String&gt; x) {
      char a;
      ArrayList&lt;String&gt; store = new ArrayList&lt;String&gt;();
      for (int i = 0; i &lt;= x.size(); i++) {
          for (int j = x.size()-1; j &gt; i; j--) {
                  for (int l = 0; l &lt; x.get(j).length(); l++) { \\error here
                      if (x.get(i).contains(
                              Character.toString(x.get(j).charAt(l)))) {
                          a = x.get(j).charAt(l);
                      store.add(Character.toString(a));
                      }
  
              }
          }
      }
      for (String element : store) {
          System.out.println(element);
      }
  }
  </code></pre>
  
  <p>I have figured out that much and i am no longer getting the error i was getting earlier, but still not able to get the char or chars common in all the strings i input.</p>