We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Separate the Numbers
You are viewing a single comment's thread. Return to all 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.