You are given a string S of length N. Your task is to find and print the maximum integer present in the string.
An integer is defined as a maximal contiguous sequence of digit characters (0-9). Any non-digit character separates two integers.
-1 if the string contains no integer.-2 if the string is empty.N, the length of the string.S.Print a single integer:
-1 if no integer is found.-2 if the string is empty.1 ≤ N ≤ 10000039
33 milestone is either 12 or 75 km away
75
The integers present in the string are 33, 12, and . The maximum among them is .
757516
abc123xyz456def
456
10
hello world
-1
The string contains no digits.
0
Commonwealth Bank of Australia - CBA • Pending