Skip to content

Commit ab117f1

Browse files
Zanger67/leetcodeZanger67/leetcode
Zanger67/leetcode
authored and
Zanger67/leetcode
committed
Updated markdown files
1 parent 4383bf1 commit ab117f1

9 files changed

+61
-8
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# **[LeetCode Records](https://leetcode.com/u/Zanger/)** (611 solved)
1+
# **[LeetCode Records](https://leetcode.com/u/Zanger/)** (612 solved)
22

33
<!-- This readme was generated using [WikiLeet](<https://github.com/Zanger67/WikiLeet>) -->
44

@@ -377,6 +377,7 @@ This repo is a collection of my LeetCode solutions, primarily written in Python,
377377
| 1325 | [Delete Leaves With a Given Value](<https://leetcode.com/problems/delete-leaves-with-a-given-value>) | Medium | | [solution](<markdowns/_1325. Delete Leaves With a Given Value.md>) | py |
378378
| 1334 | [Find the City With the Smallest Number of Neighbors at a Threshold Distance](<https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance>) | Medium | Daily | [solution](<markdowns/_1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance.md>) | py |
379379
| 1351 | [Count Negative Numbers in a Sorted Matrix](<https://leetcode.com/problems/count-negative-numbers-in-a-sorted-matrix>) | Easy | | [solution](<markdowns/_1351. Count Negative Numbers in a Sorted Matrix.md>) | java, py |
380+
| 1358 | [Number of Substrings Containing All Three Characters](<https://leetcode.com/problems/number-of-substrings-containing-all-three-characters>) | Medium | | [solution](<markdowns/_1358. Number of Substrings Containing All Three Characters.md>) | py |
380381
| 1367 | [Linked List in Binary Tree](<https://leetcode.com/problems/linked-list-in-binary-tree>) | Medium | Daily | [solution](<markdowns/_1367. Linked List in Binary Tree.md>) | py |
381382
| 1368 | [Minimum Cost to Make at Least One Valid Path in a Grid](<https://leetcode.com/problems/minimum-cost-to-make-at-least-one-valid-path-in-a-grid>) | Hard | Daily | [solution](<markdowns/_1368. Minimum Cost to Make at Least One Valid Path in a Grid.md>) | py |
382383
| 1372 | [Longest ZigZag Path in a Binary Tree](<https://leetcode.com/problems/longest-zigzag-path-in-a-binary-tree>) | Medium | | [solution](<markdowns/_1372. Longest ZigZag Path in a Binary Tree.md>) | py |

markdowns/Medium.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Medium Questions (395)
1+
# Medium Questions (396)
22

33
*[Back to top](<../README.md>)*
44

@@ -220,6 +220,7 @@
220220
| 1315 | [Sum of Nodes with Even-Valued Grandparent](<https://leetcode.com/problems/sum-of-nodes-with-even-valued-grandparent>) | Medium | | [solution](<_1315. Sum of Nodes with Even-Valued Grandparent.md>) | py | Jun 12, 2024 |
221221
| 1325 | [Delete Leaves With a Given Value](<https://leetcode.com/problems/delete-leaves-with-a-given-value>) | Medium | | [solution](<_1325. Delete Leaves With a Given Value.md>) | py | Aug 22, 2024 |
222222
| 1334 | [Find the City With the Smallest Number of Neighbors at a Threshold Distance](<https://leetcode.com/problems/find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance>) | Medium | Daily | [solution](<_1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance.md>) | py | Jul 26, 2024 |
223+
| 1358 | [Number of Substrings Containing All Three Characters](<https://leetcode.com/problems/number-of-substrings-containing-all-three-characters>) | Medium | | [solution](<_1358. Number of Substrings Containing All Three Characters.md>) | py | Mar 11, 2025 |
223224
| 1367 | [Linked List in Binary Tree](<https://leetcode.com/problems/linked-list-in-binary-tree>) | Medium | Daily | [solution](<_1367. Linked List in Binary Tree.md>) | py | Sep 07, 2024 |
224225
| 1372 | [Longest ZigZag Path in a Binary Tree](<https://leetcode.com/problems/longest-zigzag-path-in-a-binary-tree>) | Medium | | [solution](<_1372. Longest ZigZag Path in a Binary Tree.md>) | py | Jul 05, 2024 |
225226
| 1376 | [Time Needed to Inform All Employees](<https://leetcode.com/problems/time-needed-to-inform-all-employees>) | Medium | | [solution](<_1376. Time Needed to Inform All Employees.md>) | py | Oct 26, 2024 |

markdowns/Questions_By_Code_Length.md

+1
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ Calculations are based on the code files's byte sizes.
509509
| 1376 | [Time Needed to Inform All Employees](<https://leetcode.com/problems/time-needed-to-inform-all-employees>) | Medium | | [solution](<_1376. Time Needed to Inform All Employees.md>) | py | Oct 26, 2024 |
510510
| 977 | [Squares of a Sorted Array](<https://leetcode.com/problems/squares-of-a-sorted-array>) | Easy | | [solution](<_977. Squares of a Sorted Array.md>) | py | Jun 21, 2024 |
511511
| 1780 | [Check if Number is a Sum of Powers of Three](<https://leetcode.com/problems/check-if-number-is-a-sum-of-powers-of-three>) | Medium | Daily | [solution](<_1780. Check if Number is a Sum of Powers of Three.md>) | py | Mar 04, 2025 |
512+
| 1358 | [Number of Substrings Containing All Three Characters](<https://leetcode.com/problems/number-of-substrings-containing-all-three-characters>) | Medium | | [solution](<_1358. Number of Substrings Containing All Three Characters.md>) | py | Mar 11, 2025 |
512513
| 1748 | [Sum of Unique Elements](<https://leetcode.com/problems/sum-of-unique-elements>) | Easy | | [solution](<_1748. Sum of Unique Elements.md>) | c | Jun 06, 2024 |
513514
| 1436 | [Destination City](<https://leetcode.com/problems/destination-city>) | Easy | | [solution](<_1436. Destination City.md>) | java | Jun 01, 2024 |
514515
| 330 | [Patching Array](<https://leetcode.com/problems/patching-array>) | Hard | Daily | [solution](<_330. Patching Array.md>) | py | Jun 16, 2024 |

markdowns/Questions_By_Recent.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Calculations are based on the date of the first solve.
66

77
| # | Title | Level | Cats | Solution | Languages | Date Complete |
88
|-----:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------|:--------------------------|:----------------------------------------------------------------------------------------------------|:--------------------------------------------|:----------------|
9+
| 1358 | [Number of Substrings Containing All Three Characters](<https://leetcode.com/problems/number-of-substrings-containing-all-three-characters>) | Medium | | [solution](<_1358. Number of Substrings Containing All Three Characters.md>) | py | Mar 11, 2025 |
910
| 1100 | [Find K-Length Substrings With No Repeated Characters](<https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters>) | Medium | Weekly Premium | [solution](<_1100. Find K-Length Substrings With No Repeated Characters.md>) | py | Mar 10, 2025 |
1011
| 3306 | [Count of Substrings Containing Every Vowel and K Consonants II](<https://leetcode.com/problems/count-of-substrings-containing-every-vowel-and-k-consonants-ii>) | Medium | Daily | [solution](<_3306. Count of Substrings Containing Every Vowel and K Consonants II.md>) | py | Mar 10, 2025 |
1112
| 2379 | [Minimum Recolors to Get K Consecutive Black Blocks](<https://leetcode.com/problems/minimum-recolors-to-get-k-consecutive-black-blocks>) | Easy | Daily | [solution](<_2379. Minimum Recolors to Get K Consecutive Black Blocks.md>) | py | Mar 08, 2025 |

markdowns/Topics.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
------
66

77
- [Array](<by_topic/Array.md>) (300 completed)
8-
- [String](<by_topic/String.md>) (142 completed)
9-
- [Hash Table](<by_topic/Hash Table.md>) (136 completed)
8+
- [String](<by_topic/String.md>) (143 completed)
9+
- [Hash Table](<by_topic/Hash Table.md>) (137 completed)
1010
- [Depth-First Search](<by_topic/Depth-First Search.md>) (103 completed)
1111
- [Tree](<by_topic/Tree.md>) (91 completed)
1212
- [Binary Tree](<by_topic/Binary Tree.md>) (82 completed)
@@ -26,7 +26,7 @@
2626
- [Binary Search](<by_topic/Binary Search.md>) (30 completed)
2727
- [Backtracking](<by_topic/Backtracking.md>) (27 completed)
2828
- [Heap (Priority Queue)](<by_topic/Heap (Priority Queue).md>) (26 completed)
29-
- [Sliding Window](<by_topic/Sliding Window.md>) (22 completed)
29+
- [Sliding Window](<by_topic/Sliding Window.md>) (23 completed)
3030
- [Trie](<by_topic/Trie.md>) (19 completed)
3131
- [Prefix Sum](<by_topic/Prefix Sum.md>) (19 completed)
3232
- [Recursion](<by_topic/Recursion.md>) (19 completed)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# 1358. [Number of Substrings Containing All Three Characters](<https://leetcode.com/problems/number-of-substrings-containing-all-three-characters>)
2+
3+
*All prompts are owned by LeetCode. To view the prompt, click the title link above.*
4+
5+
*[Back to top](<../README.md>)*
6+
7+
------
8+
9+
> *First completed : March 11, 2025*
10+
>
11+
> *Last updated : March 11, 2025*
12+
13+
------
14+
15+
> **Related Topics** : **[Hash Table](<by_topic/Hash Table.md>), [String](<by_topic/String.md>), [Sliding Window](<by_topic/Sliding Window.md>)**
16+
>
17+
> **Acceptance Rate** : **68.78 %**
18+
19+
------
20+
21+
## Solutions
22+
23+
- [m1358.py](<../my-submissions/m1358.py>)
24+
### Python
25+
#### [m1358.py](<../my-submissions/m1358.py>)
26+
```Python
27+
class Solution:
28+
def numberOfSubstrings(self, s: str) -> int:
29+
a = b = c = -1
30+
output = 0
31+
32+
for i, x in enumerate(s) :
33+
match x :
34+
case 'a' :
35+
a = i
36+
case 'b' :
37+
b = i
38+
case 'c' :
39+
c = i
40+
41+
if min(a, b, c) != -1 :
42+
output += 1 + min(a, b, c)
43+
44+
return output
45+
```
46+

markdowns/by_topic/Hash Table.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Hash Table](<https://leetcode.com/tag/Hash-Table/>) (136 completed)
1+
# [Hash Table](<https://leetcode.com/tag/Hash-Table/>) (137 completed)
22

33
*[Back to top](<../../README.md>)*
44

@@ -75,6 +75,7 @@
7575
| 1261 | [Find Elements in a Contaminated Binary Tree](<https://leetcode.com/problems/find-elements-in-a-contaminated-binary-tree>) | Medium | Daily | [solution](<../_1261. Find Elements in a Contaminated Binary Tree.md>) | py | Feb 21, 2025 |
7676
| 1282 | [Group the People Given the Group Size They Belong To](<https://leetcode.com/problems/group-the-people-given-the-group-size-they-belong-to>) | Medium | | [solution](<../_1282. Group the People Given the Group Size They Belong To.md>) | py | Jun 28, 2024 |
7777
| 1284 | [Minimum Number of Flips to Convert Binary Matrix to Zero Matrix](<https://leetcode.com/problems/minimum-number-of-flips-to-convert-binary-matrix-to-zero-matrix>) | Hard | | [solution](<../_1284. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix.md>) | py | Jun 09, 2024 |
78+
| 1358 | [Number of Substrings Containing All Three Characters](<https://leetcode.com/problems/number-of-substrings-containing-all-three-characters>) | Medium | | [solution](<../_1358. Number of Substrings Containing All Three Characters.md>) | py | Mar 11, 2025 |
7879
| 1400 | [Construct K Palindrome Strings](<https://leetcode.com/problems/construct-k-palindrome-strings>) | Medium | Daily | [solution](<../_1400. Construct K Palindrome Strings.md>) | py | Jan 11, 2025 |
7980
| 1426 | [Counting Elements](<https://leetcode.com/problems/counting-elements>) | Easy | | [solution](<../_1426. Counting Elements.md>) | c | Jun 04, 2024 |
8081
| 1429 | [First Unique Number](<https://leetcode.com/problems/first-unique-number>) | Medium | | [solution](<../_1429. First Unique Number.md>) | py | Oct 26, 2024 |

markdowns/by_topic/Sliding Window.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Sliding Window](<https://leetcode.com/tag/Sliding-Window/>) (22 completed)
1+
# [Sliding Window](<https://leetcode.com/tag/Sliding-Window/>) (23 completed)
22

33
*[Back to top](<../../README.md>)*
44

@@ -20,6 +20,7 @@
2020
| 1100 | [Find K-Length Substrings With No Repeated Characters](<https://leetcode.com/problems/find-k-length-substrings-with-no-repeated-characters>) | Medium | Weekly Premium | [solution](<../_1100. Find K-Length Substrings With No Repeated Characters.md>) | py | Mar 10, 2025 |
2121
| 1151 | [Minimum Swaps to Group All 1's Together](<https://leetcode.com/problems/minimum-swaps-to-group-all-1s-together>) | Medium | Weekly Premium | [solution](<../_1151. Minimum Swaps to Group All 1's Together.md>) | py | Mar 01, 2025 |
2222
| 1248 | [Count Number of Nice Subarrays](<https://leetcode.com/problems/count-number-of-nice-subarrays>) | Medium | Daily | [solution](<../_1248. Count Number of Nice Subarrays.md>) | py | Jun 22, 2024 |
23+
| 1358 | [Number of Substrings Containing All Three Characters](<https://leetcode.com/problems/number-of-substrings-containing-all-three-characters>) | Medium | | [solution](<../_1358. Number of Substrings Containing All Three Characters.md>) | py | Mar 11, 2025 |
2324
| 1438 | [Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit](<https://leetcode.com/problems/longest-continuous-subarray-with-absolute-diff-less-than-or-equal-to-limit>) | Medium | Daily | [solution](<../_1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit.md>) | java | Jun 24, 2024 |
2425
| 1493 | [Longest Subarray of 1's After Deleting One Element](<https://leetcode.com/problems/longest-subarray-of-1s-after-deleting-one-element>) | Medium | | [solution](<../_1493. Longest Subarray of 1's After Deleting One Element.md>) | py | Feb 17, 2025 |
2526
| 1852 | [Distinct Numbers in Each Subarray](<https://leetcode.com/problems/distinct-numbers-in-each-subarray>) | Medium | Weekly Premium | [solution](<../_1852. Distinct Numbers in Each Subarray.md>) | java, py | Jun 27, 2024 |

0 commit comments

Comments
 (0)