public static boolean isPermutation(String a, String b) {
		
		if(a == null || b == null)
			return false;
		if(a.length() != b.length() )
			return false;
		
		HashMap<Character,Integer> letters = new HashMap<Character, Integer>();
		
		for(int i = 0; i< a.length(); i++ ) {
			char c = a.charAt(i);
			if(letters.containsKey(c))
				letters.put(c, letters.get(c) + 1);
			else
				letters.put(c, 1);
		}
		
		for(int i = 0; i< b.length(); i++ ) {
			char c = b.charAt(i);
			if(letters.containsKey(c)) {
				int frequency = letters.get(c) -1;
				if(frequency < 0)
					return false;
				
				letters.put(c, frequency);
			}
			else
				return false;
		}
		
		return true;
	}