Question:
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:
Input: num = "52" Output: "5" Explanation: The only non-empty substrings are "5", "2", and "52". "5" is the only odd number.
Example 2:文章來源:http://www.zghlxwxcb.cn/news/detail-688817.html
Input: num = "4206" Output: "" Explanation: There are no odd numbers in "4206".
Example 3:文章來源地址http://www.zghlxwxcb.cn/news/detail-688817.html
Input: num =
到了這里,關于LeetCode --- 1903. Largest Odd Number in String 解題報告的文章就介紹完了。如果您還想了解更多內容,請在右上角搜索TOY模板網以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網!