title: Finding common characters in two strings
body: <p>I am coding for the problem in which we got to count the number of common characters in two strings. Main part of the count goes like this</p>
  
  <pre><code>for(i=0; i &lt; strlen(s1); i++) {
      for(j = 0; j &lt; strlen(s2); j++) {
          if(s1[i] == s2[j]) {
              count++;
              s2[j] = '*';
              break;
          }
      }
  }
  </code></pre>
  
  <p>This goes with an O(n^2) logic. However I could not think of a better solution than this. Can anyone help me in coding with an O(n) logic.</p>