Compress the array into Ranges
Given an array of integers of size N, The task is to print the consecutive integers as a range. Examples: Input : N = 7, arr=[7, 8, 9, 15, 16, 20, 25] Output : 7-9 15-16 20 25 Consecutive elements present are[ {7, 8, 9}, {15, 16}, {20}, {25} ] Hence output the result as 7-9 15-16 20 25 Input : N = 6