|
| 1 | +<h2><a href="https://leetcode.com/problems/convert-integer-to-the-sum-of-two-no-zero-integers">Convert Integer to the Sum of Two No-Zero Integers</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p><strong>No-Zero integer</strong> is a positive integer that <strong>does not contain any <code>0</code></strong> in its decimal representation.</p> |
| 2 | + |
| 3 | +<p>Given an integer <code>n</code>, return <em>a list of two integers</em> <code>[a, b]</code> <em>where</em>:</p> |
| 4 | + |
| 5 | +<ul> |
| 6 | + <li><code>a</code> and <code>b</code> are <strong>No-Zero integers</strong>.</li> |
| 7 | + <li><code>a + b = n</code></li> |
| 8 | +</ul> |
| 9 | + |
| 10 | +<p>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.</p> |
| 11 | + |
| 12 | +<p> </p> |
| 13 | +<p><strong class="example">Example 1:</strong></p> |
| 14 | + |
| 15 | +<pre> |
| 16 | +<strong>Input:</strong> n = 2 |
| 17 | +<strong>Output:</strong> [1,1] |
| 18 | +<strong>Explanation:</strong> Let a = 1 and b = 1. |
| 19 | +Both a and b are no-zero integers, and a + b = 2 = n. |
| 20 | +</pre> |
| 21 | + |
| 22 | +<p><strong class="example">Example 2:</strong></p> |
| 23 | + |
| 24 | +<pre> |
| 25 | +<strong>Input:</strong> n = 11 |
| 26 | +<strong>Output:</strong> [2,9] |
| 27 | +<strong>Explanation:</strong> Let a = 2 and b = 9. |
| 28 | +Both a and b are no-zero integers, and a + b = 11 = n. |
| 29 | +Note that there are other valid answers as [8, 3] that can be accepted. |
| 30 | +</pre> |
| 31 | + |
| 32 | +<p> </p> |
| 33 | +<p><strong>Constraints:</strong></p> |
| 34 | + |
| 35 | +<ul> |
| 36 | + <li><code>2 <= n <= 10<sup>4</sup></code></li> |
| 37 | +</ul> |
0 commit comments