private boolean ContainSameDigits(int n1, int n2) {
        char[] n1String = Integer.toString(n1).toCharArray();
        char[] n2String = Integer.toString(n2).toCharArray();

        if (n1String.length != n2String.length) {
            return false;
        }

        for (int i = 0; i < n1String.length; i++) {
            boolean wasFound = false;
            for (int j = 0; j < n1String.length; j++) {
                if (n1String[i] == n2String[j]) {
                    wasFound = true;
                    break;
                }
            }

            if (!wasFound) {
                return false;
            }
        }
        for (int i = 0; i < n1String.length; i++) {
            boolean wasFound = false;
            for (int j = 0; j < n1String.length; j++) {
                if (n2String[i] == n1String[j]) {
                    wasFound = true;
                    break;
                }
            }

            if (!wasFound) {
                return false;
            }
        }

        return true;
    }