1903. Largest Odd Number in String
https://leetcode.com/problems/largest-odd-number-in-string
Description
You are given a string num
, representing a large integer. Return the largest-valued odd integer (as a string) that is a non-empty substring of num
, or an empty string ""
if no odd integer exists.
A substring is a contiguous sequence of characters within a string.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= num.length <= 105
num
only consists of digits and does not contain any leading zeros.
ac
Last updated