Convert Integer to the Sum of Two No-Zero Integers Solutions in C++Number 1317Difficulty EasyAcceptance 56.8%Link LeetCodeOther languages GoSolutionsC++ solution by liuyubobobo/Play-Leetcode/// Source : https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers//// Author : liuyubobobo/// Time : 2020-01-11 #include <iostream>#include <vector> using namespace std; /// Brute Force/// Time Complexity: O(nlogn)/// Space Complexity: O(1)class Solution {public: vector<int> getNoZeroIntegers(int n) { for(int i = 1; i <= n / 2; i ++) if(ok(i) && ok(n - i)) return {i, n - i}; return {}; } private: bool ok(int x){ while(x){ if(x % 10 == 0) return false; x /= 10; } return true; }}; int main() { return 0;}/// Source : https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers/ /// Author : liuyubobobo /// Time : 2020-01-11 #include <iostream> #include <vector> using namespace std; /// Brute Force /// Time Complexity: O(nlogn) /// Space Complexity: O(1) class Solution { public: vector<int> getNoZeroIntegers(int n) { for(int i = 1; i <= n / 2; i ++) if(ok(i) && ok(n - i)) return {i, n - i}; return {}; } private: bool ok(int x){ while(x){ if(x % 10 == 0) return false; x /= 10; } return true; } }; int main() { return 0; }