Convert Integer to the Sum of Two No-Zero Integers LeetCode solution in C++
1class Solution {2public:3int has0(int x) {4while (x) {5if (x % 10 == 0) return 1;6x /= 10;7}8return 0;9}10vector<int> getNoZeroIntegers(int n) {11for (int i = 1; i <= n; i++) {12if (has0(i) == false && has0(n - i) == false) {13return {i, n - i};14}15}16return {1, 1};17}18};