Search
⌘K

Leetcode 1796. Second Largest Digit in a String

Extract the distinct digits from an alphanumeric string and return the second-largest digit value (or -1 if fewer than two distinct digits exist). The string length is ≤500 and contains only lowercase letters and digits.

Asked at:

Spotify


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late March, 2025

Spotify

Mid-level

I was then asked how to solve kth largest number

Mid January, 2025

Spotify

Mid-level

Comments

Your account is free and you can post anonymously if you choose.