Skip to content

Commit 8fb9f1f

Browse files
Zanger67/leetcodeZanger67/leetcode
authored andcommitted
Updated markdown files
1 parent 4b37165 commit 8fb9f1f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

markdowns/Questions_By_Code_Length.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ Calculations are based on the code files's byte sizes.
337337
| 1079 | [Letter Tile Possibilities](<https://leetcode.com/problems/letter-tile-possibilities>) | Medium | Daily | [solution](<_1079. Letter Tile Possibilities.md>) | py | Feb 17, 2025 |
338338
| 687 | [Longest Univalue Path](<https://leetcode.com/problems/longest-univalue-path>) | Medium | | [solution](<_687. Longest Univalue Path.md>) | py | Jul 03, 2024 |
339339
| 1580 | [Put Boxes Into the Warehouse II](<https://leetcode.com/problems/put-boxes-into-the-warehouse-ii>) | Medium | Weekly Premium | [solution](<_1580. Put Boxes Into the Warehouse II.md>) | py | Jun 15, 2024 |
340+
| 942 | [DI String Match](<https://leetcode.com/problems/di-string-match>) | Easy | | [solution](<_942. DI String Match.md>) | py | Feb 18, 2025 |
340341
| 98 | [Validate Binary Search Tree](<https://leetcode.com/problems/validate-binary-search-tree>) | Medium | B75, N150 | [solution](<_98. Validate Binary Search Tree.md>) | c | Jun 23, 2024 |
341342
| 328 | [Odd Even Linked List](<https://leetcode.com/problems/odd-even-linked-list>) | Medium | | [solution](<_328. Odd Even Linked List.md>) | py | Jun 22, 2024 |
342343
| 807 | [Max Increase to Keep City Skyline](<https://leetcode.com/problems/max-increase-to-keep-city-skyline>) | Medium | | [solution](<_807. Max Increase to Keep City Skyline.md>) | java | Jun 22, 2024 |
@@ -449,7 +450,6 @@ Calculations are based on the code files's byte sizes.
449450
| 3163 | [String Compression III](<https://leetcode.com/problems/string-compression-iii>) | Medium | Daily | [solution](<_3163. String Compression III.md>) | py | Nov 04, 2024 |
450451
| 2610 | [Convert an Array Into a 2D Array With Conditions](<https://leetcode.com/problems/convert-an-array-into-a-2d-array-with-conditions>) | Medium | | [solution](<_2610. Convert an Array Into a 2D Array With Conditions.md>) | py | Jun 07, 2024 |
451452
| 1783 | [Grand Slam Titles](<https://leetcode.com/problems/grand-slam-titles>) | Medium | | [solution](<_1783. Grand Slam Titles.md>) | sql | Jun 07, 2024 |
452-
| 942 | [DI String Match](<https://leetcode.com/problems/di-string-match>) | Easy | | [solution](<_942. DI String Match.md>) | py | Feb 18, 2025 |
453453
| 3106 | [Lexicographically Smallest String After Operations With Constraint](<https://leetcode.com/problems/lexicographically-smallest-string-after-operations-with-constraint>) | Medium | | [solution](<_3106. Lexicographically Smallest String After Operations With Constraint.md>) | py | Jun 29, 2024 |
454454
| 287 | [Find the Duplicate Number](<https://leetcode.com/problems/find-the-duplicate-number>) | Medium | N150 | [solution](<_287. Find the Duplicate Number.md>) | c | Jun 26, 2024 |
455455
| 2352 | [Equal Row and Column Pairs](<https://leetcode.com/problems/equal-row-and-column-pairs>) | Medium | | [solution](<_2352. Equal Row and Column Pairs.md>) | py | Jun 27, 2024 |

markdowns/_942. DI String Match.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
- [e942 v1.py](<../my-submissions/e942 v1.py>)
2424
- [e942 v2.py](<../my-submissions/e942 v2.py>)
25+
- [e942 v3.py](<../my-submissions/e942 v3.py>)
2526
### Python
2627
#### [e942 v1.py](<../my-submissions/e942 v1.py>)
2728
```Python
@@ -46,3 +47,10 @@ class Solution:
4647
return [x - minn for x in output]
4748
```
4849

50+
#### [e942 v3.py](<../my-submissions/e942 v3.py>)
51+
```Python
52+
class Solution:
53+
def diStringMatch(self, s: str) -> List[int]:
54+
return [(l := 0 if 'l' not in locals() else l + 1) if c == 'I' else (r := len(s) if 'r' not in locals() else r - 1) for c in s] + [l + 1 if 'l' in locals() else r - 1]
55+
```
56+

0 commit comments

Comments
 (0)