<p>Given an alphanumeric string <code>s</code>, return <em>the <strong>second largest</strong> numerical digit that appears in </em><code>s</code><em>, or </em><code>-1</code><em> if it does not exist</em>.</p>

<p>An <strong>alphanumeric</strong><strong> </strong>string is a string consisting of lowercase English letters and digits.</p>

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

<pre>
<strong>Input:</strong> s = &quot;dfa12321afd&quot;
<strong>Output:</strong> 2
<strong>Explanation:</strong> The digits that appear in s are [1, 2, 3]. The second largest digit is 2.
</pre>

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

<pre>
<strong>Input:</strong> s = &quot;abc1111&quot;
<strong>Output:</strong> -1
<strong>Explanation:</strong> The digits that appear in s are [1]. There is no second largest digit. 
</pre>

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

<ul>
	<li><code>1 &lt;= s.length &lt;= 500</code></li>
	<li><code>s</code> consists of only lowercase English letters and digits.</li>
</ul>

class Solution:
    def secondHighest(self, s: str) -> int:
        l=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
        a = []
        for i in s:
            if i not in l:
                a.append(int(i))

        a1 = sorted(a)
        SM = -1
        Z = 0
        if sum(a) == 0:
            return -1
        for i in range(len(a1)-2,-1,-1):
            if a1[i]==0:
                Z = 1
                return 0
                break
            
            if a1[i]<a1[len(a1)-1]:
                
                SM = a1[i]
                break;
            else:
                continue
        
        if Z == 1:
            return 0 
        elif SM == -1:
            return -1
        
        return SM
51