title: Basic java code to compare char of two strings
body: <p>I want to write code that accepts two strings and returns the sum of the number of times when the char of both string does not match. </p>
  
  <pre><code>public int solution(String s1, String s2) {
      int sum = 0;
      for (int i=0; i&lt;s1.length(); i++){
          if (s1.charAt(i) != s2.charAt(i))
              sum++;
      }
      return sum;
  }
  </code></pre>
  
  <p>This code of run when the length of the two strings are the same. I want to what I need to add to the code so that if the length of <code>string 1</code> > length of <code>string 2</code>, the code still run and also include the # char chat wasn't able to be compare to <code>string 2</code> because <code>string 2</code> is shorter. (vice versa)</p>
  
  <p>ex:  </p>
  
  <pre><code>s1: aaaaab
  s2: ac
  
  ==&gt; sum =5
  </code></pre>
  
  <p>or</p>
  
  <pre><code>s1: ab
  s2: abbbb
  
  ==&gt; sum = 3
  </code></pre>