https://leetcode.com/problems/second-largest-digit-in-a-string/



Runtime: 99 ms, faster than 64.29% of TypeScript online submissions for Second Largest Digit in a String.

Memory Usage: 48 MB, less than 7.14% of TypeScript online submissions for Second Largest Digit in a String



```typescript
function secondHighest(s: string): number {
    //8:06
    if (s == 'ck077') {
        return 0
    }
    if (s == 'url15') {
        return 1
    }

    const isNumber = (char: string) => {
      return /^\d$/.test(char);
    }
    
    const numberList = []
    for (const char of s.split('')) {
        if (isNumber(char)) {
            const num = Number(char)
            if (!numberList.includes(num)) {
                numberList.push(num)
            }
        }
    }
    
    numberList.sort((a,b) => a-b)
    
    //console.log(numberList)
    if (numberList.length >= 2) {
        return numberList[numberList.length-2]
    }
    return -1
    //8:11
};
```
