A program that produces comma delimited lists of numbers, grouping them into ranges when these lists are sequential. In this context, a sequence is defined as two consecutive numbers with an interval of one between them. It is assumed that the input consists of sorted numbers.
The input contains multple test cases. The first line of the input contains the integer
For each input case, the output must start with a line that contains the case number
As previously explained (Output structure), the suggested output follows the same structure. The name of the suggested output must match the name of the input and the extension file should end with .suggested, i.e testName.suggested
Note: The end of the content should be a single new line without a leading white space (See suggested output examples in the testcases folder)
Extract impact.zip file. Open the extract folder. You can run the program manual or run with provided script file.
Open terminal and navigate to the extracted impact directory and excecute the followeing command:
javac numberrangesummarizer/*.java
java numberrangesummarizer.Main<testcases/testName.txt
where testName is the name of the test case
Similarily, open terminal and navigete to the impact directory.
Use the provided rushtests.sh srcipt file as follows (This script is designed for Linux users):
./runtests.sh
Note: If You wish to include more testcases, include them in the testcases folder as well as their corresponding suggested output
Imported library includes:
java.util.ArrayList
java.util.Collection
java.util.Iterator
java.io.BufferedReader
java.io.IOException
java.io.InputStreeamReader
No extenal libraries used for this program.