Simple numeric reconstruction
Input
[(1, 3), (2, 1)]
Output
[1, 1, 1, 2]
1 repeated 3 times, then 2 repeated once.
Full lesson preview
Build a flattened list by repeating values according to provided counts.
Problem statement
Task
Examples
Input
[(1, 3), (2, 1)]
Output
[1, 1, 1, 2]
1 repeated 3 times, then 2 repeated once.
Input format
Output format
Constraints
Samples
Input
[('a', 2), ('b', 0), ('a', 1)]
Output
['a', 'a', 'a']
First 'a' twice, then 'b' zero times (skipped), then 'a' once more.