1317. Convert Integer to the Sum of Two No-Zero Integers Easy
1/**
2 * [1317] Convert Integer to the Sum of Two No-Zero Integers
3 *
4 * No-Zero integer is a positive integer that does not contain any 0 in its decimal representation.
5 * Given an integer n, return a list of two integers [A, B] where:
6 *
7 * A and B are No-Zero integers.
8 * A + B = n
9 *
10 * The test cases are generated so that there is at least one valid solution. If there are many valid solutions you can return any of them.
11 *
12 * Example 1:
13 *
14 * Input: n = 2
15 * Output: [1,1]
16 * Explanation: A = 1, B = 1. A + B = n and both A and B do not contain any 0 in their decimal representation.
17 *
18 * Example 2:
19 *
20 * Input: n = 11
21 * Output: [2,9]
22 *
23 *
24 * Constraints:
25 *
26 * 2 <= n <= 10^4
27 *
28 */
29pub struct Solution {}
30
31// problem: https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers/
32// discuss: https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers/discuss/?currentPage=1&orderBy=most_votes&query=
33
34// submission codes start here
35
36impl Solution {
37 pub fn get_no_zero_integers(n: i32) -> Vec<i32> {
38 vec![]
39 }
40}
41
42// submission codes end
43
44#[cfg(test)]
45mod tests {
46 use super::*;
47
48 #[test]
49 fn test_1317() {
50 }
51}
52
Back
© 2025 bowen.ge All Rights Reserved.