Java 0ms solution with explanation
Concept : We can iterate through  i = 1 to i = n  and check if A (n) and B (n - i) numbers contains zero or not.\n\nNow there can be many methods to check if nu
Concept : We can iterate through <b> i = 1 to i = n </b> and check if A (n) and B (n - i) numbers contains zero or not.\n\nNow there can be many methods to check if number contains zero or not.\n\n<pre>\nMethod 1: String.valueOf(i).contains("0") && String.valueOf(n-i).contains("0")\nMethod 2: Integer.toString(i).contains("0") && Integer.toString(n-i).contains("0")\nMethod 3: Use while loop and every time take mod of 10 and check if reminder is zero or not.\n</pre>\n\nIf you use method 1 then time complexity will be higher (in this case 48ms) because in-built function will take time to convert int to string and then check if zero is in the string or not.\n\nFor method 2, time complexity will also higher than zero because it is also using in-built function.\n\nBut if we use method 3 then for large numbers it will be less time consuming because we divide number by 10 each time. So this will use less time.\n<b>Time complexity for this will be 0ms.</b>\n\nSo it will be helpful if you don\'t use the in-built function in some case.\n\n<br>\nSolution :\n\n```\nclass Solution {\n    \n    public boolean containZero(int n) {\n        while(n > 0) {\n            int rem = n % 10;\n            if(rem == 0)\n                return true;\n            n = n/10;\n        }\n        return false;\n    }\n    \n    public int[] getNoZeroIntegers(int n) {\n                \n        for(int i=1; i<n; i++) {\n            if(!containZero(i) && !containZero(n-i)) {\n                return new int[]{ n - i, i};\n            }\n        }\n        return null;\n    }\n}\n```
['Java']