Separate the Numbers

  • + 2 comments

    we can consider the string of UNSIGNED LONG LONG INT type giving it a range of 2^64-1 which is equal to 18446744073709551615 and declare it like unsigned long long int str[18446744073709551615]; --> containing values of continuous integers 0,1,2,3,4,5,6,7,8,9,10,11,12........

    now string of any of the test cases can have a string as long as 32 characters as stated in ques. This input string can be matched in the above string (str) using search algorithm in stl giving the iterator to the first matched position.

    the need to take str of 2^64-1 is that we never know from where will the input string will start like in a test case it was started from 101.