You are given a string num representing a large integer.
Return the largest-valued odd integer (as a string) that is a non-empty prefix of num, or an empty string '' if no odd integer exists.
An integer is odd if its last digit is odd.
Input: A string num of digit characters.
Output: The longest prefix of num that ends with an odd digit, or '' if none exists.
Input: 52
Output: 5
Explanation: Prefixes: '5'(odd),'52'(even). Largest odd prefix is '5'.Input: 4206
Output:
Explanation: All prefixes end in even digits → no odd prefix.Input: 35427
Output: 35427
Explanation: '35427' ends in 7 (odd) → whole string is valid.1 <= num.length <= 10^5num consists of only digit charactersnum does not have leading zeros except '0' itself