public static boolean checkAnagrams(String p,String q){
		if(p.length() == 0){
			if(q.length() == 0)
				return true;
			else
				return false;
		}
		else
			if(q.length() == 0)
				return false;
			
		char[] arr1 = p.toCharArray();
		char[] arr2 = q.toCharArray();
		HashMap<Character,Integer> hm = new HashMap<Character,Integer>();
		
		for(char tmp : arr1){
			if(!hm.containsKey(tmp))
				hm.put(tmp,1);
			else
				hm.put(tmp,hm.get(tmp) + 1);
		}
		for(char tmp : arr2){
			if(hm.containsKey(tmp))
				hm.put(tmp,hm.get(tmp) - 1);
			else
				return false;
		}
		
		Set<Character> keys = hm.keySet();
		for(char k : keys){
			if(hm.get(k) != 0)
				return false;
		}
		return true;
		
		
	}