Small test case data : //as per format given test cases first 1 5 3 7 10 9 1 7 1 8 1 2