public static boolean sameDigits(int a, int b) {
		int[] digitsA = new int[10];
		int[] digitsB = new int[10];
		while (a > 0) {
			digitsA[a % 10]++;
			a /= 10;
		}
		while (b > 0) {
			digitsB[b % 10]++;
			b /= 10;
		}

		return Arrays.equals(digitsA, digitsB);
	}