We are going to add all the values of array into the Set. The code then takes the number N given by the user and finds all possible combination of consecutive naturalnumbers which add up to give the N. Because later on we are going to check consecutive numbers as well.
I testlength - 1.
I testlength - 1. For i in range start end 1. If the next character is numeric then again add this char to the exiting temp string. Logic is to run the loop from index 0 to length-1 and check each char whether is numeric or not.