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: app/docs/CommunityShare/Leetcode/2309兼具大小写的最好英文字母_translated.md
+14-11Lines changed: 14 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
---
2
-
title: 2309. The best English letters with both appropriates and lowercases One question daily
3
-
date: '2024.01.01 0:00'
2
+
title: >-
3
+
2309. The best English letters with both appropriates and lowercases One
4
+
question daily
5
+
date: "2024.01.01 0:00"
4
6
tags:
5
7
- - Python
6
8
- - answer
@@ -9,6 +11,7 @@ tags:
9
11
- - Hash table
10
12
- - C++
11
13
abbrlink: b4953d62
14
+
docId: mc2rjsq7syibclikyhomsbft
12
15
---
13
16
14
17
[2309. The best English letters with both appropriates and lowercases](https://leetcode.cn/problems/greatest-english-letter-in-upper-and-lower-case/description/)
@@ -17,18 +20,17 @@ abbrlink: b4953d62
17
20
18
21
1. Hash table:The first thing to think of the question is to solve it with a dictionary。But find that you can directly traverse the alphabet,fromZStart looking for,See if the applause exists,Just return directly。
19
22
20
-
*Running time exceeds99.9%*
21
-
2. Bit operation:We can use two integers mask1 and mask2 Record string separately s 中出现的小写字母and大写字母,in mask1 First i
23
+
_Running time exceeds99.9%_ 2. Bit operation:We can use two integers mask1 and mask2 Record string separately s 中出现的小写字母and大写字母,in mask1 First i
22
24
Position representation i Does a lowercase letter appear,and mask2 First i Position representation i Whether an uppercase letter appears。
23
25
24
26
Then we will mask1 and mask2 Perform and calculate,The results obtained mask First i Position representation i Whether the lethals of the letter appear at the same time。
25
27
26
28
As long as you get mask The highest level of binary representation 1 s position,Convert it to the corresponding capital letter。If all binary positions are not 1,Explain that there is no letter that appears at the same time,,Return to an empty string。
0 commit comments