Split Into Digits
Imagine a stream of numbers that needs to be broken into individual digits without losing the original order. Write a function separate_digits that receives a list of positive integers nums. For each number, write out its digits from left to right. Return one combined list of all digits.
Примеры
Ввод
[13, 25, 83, 77]Вывод
[1, 3, 2, 5, 8, 3, 7, 7]Ввод
[7, 1, 3, 9]Вывод
[7, 1, 3, 9]Ввод
[100]Вывод
[1, 0, 0]Нужно реализовать
def separate_digits(nums: list[int]) -> list[int]:
Теги
arraymath
Jelentkezz be a beküldési előzmények megtekintéséhez
BejelentkezésJelentkezz be az MI-mentor használatához
BejelentkezésVisible tests
1
Input
[13,25,83,77]Expected
[1,3,2,5,8,3,7,7]2
Input
[7,1,3,9]Expected
[7,1,3,9]3
Input
[100]Expected
[1,0,0]4
Input
[5]Expected
[5]5
Input
[10,20]Expected
[1,0,2,0]6
Input
[999]Expected
[9,9,9]Focus radio
Paused · SomaFM · Fluid