#93. 生成指定范围整数序列
生成指定范围整数序列
Generate Integer Sequence
Background
Congcong is currently learning how to generate number sequences. He would like your help to write a program that can generate a specific integer sequence based on given start and end numbers.
Problem Description
Given start and end numbers, return a new array containing the sequence of integers from start up to but not including end. For example, if start=5 and end=10, the result is {5, 6, 7, 8, 9}. The end number end will be greater than or equal to the start number start. Note that a length- array is valid.
Input Format
Input is given from standard input in the following format.
start end
Output Format
Output should be printed to standard output in the following format.
[num1, num2, ..., numK]
Sample
5 10
[5, 6, 7, 8, 9]
11 18
[11, 12, 13, 14, 15, 16, 17]
1 3
[1, 2]
Sample Explanation
For the first sample, start is and end is . We need to generate an integer sequence starting from and ending before (not including ), which is . Thus, the output is [5, 6, 7, 8, 9].
Constraints
Time limit: 1 second, Memory limit: 1024 KB.