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/2299强密码检验器II_translated.md
+5-3Lines changed: 5 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,14 @@
1
1
---
2
2
title: One question daily 2299. Code inspection device II
3
-
date: '2024.01.01 0:00'
3
+
date: "2024.01.01 0:00"
4
4
tags:
5
5
- - Python
6
6
- - answer
7
7
- - Bit operation
8
8
abbrlink: 7ded25bb
9
+
docId: fxn6bn619g3a9l98l9vggpg1
9
10
---
10
11
11
-
12
-
13
12
Excess when executing100%User,What can I say about this question,But one**Bit operation**Knowledge point
14
13
15
14
# My code:
@@ -35,14 +34,17 @@ class Solution:
35
34
returnTrue
36
35
returnFalse
37
36
```
37
+
38
38
# Bit operation代码:
39
+
39
40
method one:simulation + Bit operation
40
41
41
42
According to the description of the topic,我们可以simulation检查密码是否满足题目要求的过程。
42
43
43
44
first,We check whether the length of the password is less than 8,in the case of,Then return false。
44
45
45
46
Next,We use a mask mask To record whether the password contains a lowercase letter、uppercase letter、Numbers and special characters。We traverse the password,Like a character every time,First determine whether it is the same as the previous character,in the case of,Then return false。Then,Update mask according to the type of character mask。at last,We check the mask mask Whether it is 15,in the case of,Then return true,否Then return false。
0 commit comments