I am going to find sequential string of numbers in string which starts from 1. For example I have this string.
"456000123456009123456780001234000"
Here sequential strings would be
"123456", "12345678", "1234"
How can I get above result using Javascript efficiently? The code looks like this.
findSequential("456000123456009123456780001234000");
//expected output
"123456", "12345678", "1234"
***note: "1" itself is not sequential, for example:
"3938139" - has no sequence
"39381249" - has "12"
With any language's solution would be appreciated but prefer Javascript or C. Thanks for your help!