On a factory assembly line, each pallet carries a stenciled batch number (a positive integer with no leading zero) as it passes a digit scanner mounted over the conveyor belt. The scanner reads every pallet's number digit by digit, left to right, before the next pallet arrives. Given the sequence of batch numbers on the belt, in order, output the complete stream of individual digits exactly as the scanner would record them: each number's digits in their original left-to-right order, and the numbers themselves processed in belt order.
n — the number of pallets on the belt.n space-separated positive integers, the batch numbers in belt order.Print a single line containing every digit from every batch number, in order, separated by single spaces.
1 <= n <= 10001 <= batch number <= 10^5 for every palletExample 1
Input
4 13 25 83 77
Expected
1 3 2 5 8 3 7 7
Explanation
The belt carries 13, 25, 83, 77 in order. Splitting each into digits left to right gives 1,3 then 2,5 then 8,3 then 7,7, concatenated as '1 3 2 5 8 3 7 7'.
Example 2
Input
3 7 10 999
Expected
7 1 0 9 9 9
Explanation
The belt carries 7, 10, 999. Digit streams: 7 -> '7'; 10 -> '1','0'; 999 -> '9','9','9'. Concatenated: '7 1 0 9 9 9'.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →