public static long solution1(HashMap<Integer, Integer> resource, Integer preEle) {
		boolean hasLeft = false;
		for(Integer ele : resource.keySet()) {
			if(resource.get(ele)!=0) {
				hasLeft = true;
			}
		}
		if(!hasLeft) return 1;
		
		long count = 0;
		for(Integer ele : resource.keySet()) {
			if(ele==preEle || resource.get(ele)==0) {
				continue;
			}
			
			resource.put(ele, resource.get(ele)-1);
			count += solution1(resource, ele);
			resource.put(ele, resource.get(ele)+1);
		}
		
		return count;
	}