title: Anagram algorithm objective C
body: <p>i have written the following code to check anagram want to know is this perfect &amp; is there any better way to implement the same in objective C</p>
  
  <pre><code>-(BOOL) findAnagram :(NSString *) string1 :(NSString *) string2
  {
      int len = string1.length;
      if (len != string2.length)
      {
          return false;
      }
  
      for (int i=0; i &lt; len; i++)
      {
          int h = 0;
          int q = 0;
          for (int k = 0;  k &lt; len ; k ++)
          {
              if ([string1 characterAtIndex:i] == [string1 characterAtIndex:k])
              {
                  h++;
              }
              if ([string1 characterAtIndex:i] == [string2 characterAtIndex:k])
              {
                  q++;
              }
          }
  
          if (h!=q)
          {
              return false;
          }
      }
      return TRUE;
  }
  </code></pre>