You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: leetcode/3101-3200/3174.Clear-Digits/README.md
+24-13Lines changed: 24 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,39 @@
1
1
# [3174.Clear Digits][title]
2
2
3
-
> [!WARNING|style:flat]
4
-
> This question is temporarily unanswered if you have good ideas. Welcome to [Create Pull Request PR](https://github.com/kylesliu/awesome-golang-algorithm)
5
-
6
3
## Description
4
+
You are given a string `s`.
5
+
6
+
Your task is to remove **all** digits by doing this operation repeatedly:
7
+
8
+
- Delete the first digit and the **closest non-digit** character to its left.
9
+
10
+
Return the resulting string after removing all digits.
7
11
8
12
**Example 1:**
9
13
10
14
```
11
-
Input: a = "11", b = "1"
12
-
Output: "100"
13
-
```
15
+
Input: s = "abc"
16
+
17
+
Output: "abc"
14
18
15
-
## 题意
16
-
> ...
19
+
Explanation:
17
20
18
-
## 题解
21
+
There is no digit in the string.
22
+
```
23
+
24
+
**Example 2:**
19
25
20
-
### 思路1
21
-
> ...
22
-
Clear Digits
23
-
```go
24
26
```
27
+
Input: s = "cb34"
28
+
29
+
Output: ""
25
30
31
+
Explanation:
32
+
33
+
First, we apply the operation on s[2], and s becomes "c4".
34
+
35
+
Then we apply the operation on s[1], and s becomes "".
0 commit comments