Given an integer n. No-Zero integer is a positive integer which doesn’t contain any 0 in its decimal representation.
Return a list of two integers [A, B] where:
A and B are No-Zero integers.
A + B = n
It’s guarateed that there is at least one valid solution. If there are many valid solutions you can return any of them.
Example 1:
1 | Input: n = 2 |
Example 2:
1 | Input: n = 11 |
Example 3:
1 | Input: n = 10000 |
Example 4:
1 | Input: n = 69 |
Example 5:
1 | Input: n = 1010 |
要把一個整數拆成2整數和,沒有限制怎麼拆(那不是拆1出來就好)直接跑也過了,但總覺得怪,在看其他人怎麼做之後選了比較好懂的做法,簡單來說就是找可以拆的數字,再格式化輸出,學到了格式化輸出。
如果你覺得這篇文章很棒,請你不吝點讚 (゚∀゚)