Convert Integer to the Sum of Two No-Zero Integers LeetCode solution in Java

1
class Solution {
2
public int[] getNoZeroIntegers(int n) {
3
int B;
4
for (int A = 1; A < n; ++A) {
5
B = n - A;
6
if (!(A + "").contains("0") && !(B + "").contains("0")) return new int[] {A, B};
7
}
8
return new int[] {};
9
}
10
}

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0