<p>You are given a string <code>num</code>, representing a large integer. Return <em>the <strong>largest-valued odd</strong> integer (as a string) that is a <strong>non-empty substring</strong> of </em><code>num</code><em>, or an empty string </em><code>&quot;&quot;</code><em> if no odd integer exists</em>.</p>

<p>A <strong>substring</strong> is a contiguous sequence of characters within a string.</p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> num = &quot;52&quot;
<strong>Output:</strong> &quot;5&quot;
<strong>Explanation:</strong> The only non-empty substrings are &quot;5&quot;, &quot;2&quot;, and &quot;52&quot;. &quot;5&quot; is the only odd number.
</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> num = &quot;4206&quot;
<strong>Output:</strong> &quot;&quot;
<strong>Explanation:</strong> There are no odd numbers in &quot;4206&quot;.
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> num = &quot;35427&quot;
<strong>Output:</strong> &quot;35427&quot;
<strong>Explanation:</strong> &quot;35427&quot; is already an odd number.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= num.length &lt;= 10<sup>5</sup></code></li>
	<li><code>num</code> only consists of digits and does not contain any leading zeros.</li>
</ul>

class Solution:
    def largestOddNumber(self, num: str) -> str:
        # odd = ""

        # largest = 0

        # for num in num:
        #     odd += num
        #     if int(odd) % 2 > 0:
        #         largest = max(int(odd), largest)

        # return str(largest) if largest > 0 else ""       

        

        # for i in range(len(num) - 1, -1, -1):
        #     if int(num[i]) % 2 == 1:
        #         return num[:i + 1]
        # return ""



        # left, right = 0, len(num) - 1

        # while right >= 0:
        #     if num[right] in '13579':
        #         return num[:right + 1]
        #     right -= 1

        # return ""



        LOI = -1

        for i in range(len(num)):
            if num[i] in "13579":
                LOI = i

        return num[:LOI + 1] if LOI != -1 else ""
74