Java O(log(N)) solution, process each digit in N from right to left
Consider each digit from right to left, if the digit is >1, then just split that digit to 1 and (digit -1). If the digit is <= 1, there are two cases, if the di
Consider each digit from right to left, if the digit is >1, then just split that digit to 1 and (digit -1). If the digit is <= 1, there are two cases, if the digit is from the highest bit, then just split it to 1 and 0, since 0 in the highest bit not count, otherwise, bring 10 from the higher bit, and split it to 5 and (10 + digit) - 5.\n```\nclass Solution {\n    public int[] getNoZeroIntegers(int n) {\n        int a = 0, b = 0;\n        int divisor = 1;\n        while (n > 0) {\n\t\t\t// Current digit\n            int rem = n % 10;\n\t\t\t// If digit is < 2 and there are higher bit available, bollow 10 from the higher bit, and split the digit to 5 and (digit + 10 - 5)\n            if (rem < 2 & n > 2) {\n\t\t\t\t// The higher bit will decrease by 1 for borrowing to lower digit.\n                n = n / 10 - 1;\n                a += 5 * divisor;\n                b += (rem + 10 - 5) * divisor; \n            } else {\n\t\t\t\t//Otherwise, just split the digit to 1 and digit - 1\n                n = n / 10;\n                a += divisor;\n                b += (rem - 1) * divisor; \n            }\n            divisor *= 10;\n        }\n        return new int[] {a, b};\n    }\n}
[]