# 1796. Second Largest Digit in a String

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

## Description

Given an alphanumeric string `s`, return *the **second largest** numerical digit that appears in* `s`*, or* `-1` *if it does not exist*.

An **alphanumeric**string is a string consisting of lowercase English letters and digits.

**Example 1:**

```
**Input:** s = "dfa12321afd"
**Output:** 2
**Explanation:** The digits that appear in s are [1, 2, 3]. The second largest digit is 2.
```

**Example 2:**

```
**Input:** s = "abc1111"
**Output:** -1
**Explanation:** The digits that appear in s are [1]. There is no second largest digit. 
```

**Constraints:**

* `1 <= s.length <= 500`
* `s` consists of only lowercase English letters and/or digits.

## ac

```java
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://jaywin.gitbook.io/leetcode/solutions/1796-second-largest-digit-in-a-string.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
