daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Apr 16th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public boolean isAnagram(String s, StringBuilder sb)
  2.     {
  3.         if(s.equals(sb))
  4.         {
  5.             return false;
  6.         }
  7.         if(s.length()!=sb.length())
  8.             return false;
  9.        
  10.         for(int i = 0; i < s.length(); i++)
  11.         {
  12.             for(int ii = 0; ii < sb.length(); ii++)
  13.                 if(s.charAt(i) == sb.charAt(ii))
  14.                     {
  15.                      sb.deleteCharAt(ii);
  16.                      break;
  17.                    
  18.                     }  
  19.         }
  20.        
  21.         if(sb.length() ==0)
  22.             return true;
  23.         return false;
  24.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top