Largest Odd Number in String
num is a string of digits that represents a big number. Among all the contiguous pieces of num (substrings), return the one with the largest numeric value that is odd, as a string. If no piece is odd, return an empty string.
Example 1
num "52"
returns "5"
Pieces 5, 2, 52: the only odd one is 5.
Example 2
num "4206"
returns ""
No odd digit exists.
Constraints
1 <= len(num) <= 20numhas digits and does not start with0
Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.