#K62427. Decompress Ranges
Decompress Ranges
Decompress Ranges
Decompress Ranges
You are given a single string that encodes one or more ranges of consecutive integers. Each range is represented in the format \(a-b\), which denotes all integers from \(a\) to \(b\) (inclusive). Multiple ranges are separated by commas.
Your task is to decompress this string into the full list of integers and output them in order, separated by single spaces.
inputFormat
Input is provided via stdin as a single line containing the encoded ranges. For example: 1-3,5-7
.
outputFormat
Output the decompressed list of integers on a single line separated by spaces via stdout. For the above input, the output should be: 1 2 3 5 6 7
.## sample
1-3,5-7
1 2 3 5 6 7