Company: HIGH RADIUS_13thjuly
Difficulty: medium
Max Integer in String You are given a string str of length n . Inside it, an integer is a maximal contiguous block of digit characters 0 - 9 — maximal meaning that the character just before the block and the character just after it are not digits. Find the largest integer that appears in str and print it. If str contains no digit at all, print -1 . If str is empty, print -2 . A block of digits is read as an ordinary non-negative decimal number, so leading zeros carry no value: the block 007 is the integer 7 , and the block 000 is the integer 0 . Print the answer in its normal form, without leading zeros. Input Format The input consists of two lines: The first line contains the integer n . The second line contains the string str , made of exactly n characters. str may contain spaces, including leading and trailing ones, so it has to be read as a whole line rather than as a whitespace-separated token. When n is 0 the second line is empty. Output Format Print a single line: the largest in