Skip to content

Commit c99fa95

Browse files
committed
Merge branch 'main' of https://github.com/Zanger67/leetcode
2 parents 44c09b4 + 4e75108 commit c99fa95

8 files changed

+53
-5
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# **[LeetCode Records](https://leetcode.com/u/Zanger/)** (424 solved)
1+
# **[LeetCode Records](https://leetcode.com/u/Zanger/)** (425 solved)
22

33
> My LeetCode Profile: [Zanger](https://leetcode.com/u/Zanger/)
44
@@ -270,6 +270,7 @@ This repo is a collection of my LeetCode solutions, primarily written in Python,
270270
| 1166 | [Design File System](<https://leetcode.com/problems/design-file-system>) | Medium | | [solution](<markdowns/_1166. Design File System.md>) | py |
271271
| 1171 | [Remove Zero Sum Consecutive Nodes from Linked List](<https://leetcode.com/problems/remove-zero-sum-consecutive-nodes-from-linked-list>) | Medium | | [solution](<markdowns/_1171. Remove Zero Sum Consecutive Nodes from Linked List.md>) | py |
272272
| 1184 | [Distance Between Bus Stops](<https://leetcode.com/problems/distance-between-bus-stops>) | Easy | | [solution](<markdowns/_1184. Distance Between Bus Stops.md>) | py |
273+
| 1190 | [Reverse Substrings Between Each Pair of Parentheses](<https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses>) | Medium | Daily | [solution](<markdowns/_1190. Reverse Substrings Between Each Pair of Parentheses.md>) | py |
273274
| 1209 | [Remove All Adjacent Duplicates in String II](<https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii>) | Medium | | [solution](<markdowns/_1209. Remove All Adjacent Duplicates in String II.md>) | py |
274275
| 1218 | [Longest Arithmetic Subsequence of Given Difference](<https://leetcode.com/problems/longest-arithmetic-subsequence-of-given-difference>) | Medium | | [solution](<markdowns/_1218. Longest Arithmetic Subsequence of Given Difference.md>) | py |
275276
| 1233 | [Remove Sub-Folders from the Filesystem](<https://leetcode.com/problems/remove-sub-folders-from-the-filesystem>) | Medium | | [solution](<markdowns/_1233. Remove Sub-Folders from the Filesystem.md>) | py |

markdowns/Daily_Questions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Dates are for the date I completed the question so due to the my time zone and h
66

77
| # | Title | Level | Cats | Solution | Languages | Date Complete |
88
|-----:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------|:------------|:---------------------------------------------------------------------------------------------------|:-----------------------------|:----------------|
9+
| 1190 | [Reverse Substrings Between Each Pair of Parentheses](<https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses>) | Medium | Daily | [solution](<_1190. Reverse Substrings Between Each Pair of Parentheses.md>) | py | Jul 11, 2024 |
910
| 1598 | [Crawler Log Folder](<https://leetcode.com/problems/crawler-log-folder>) | Easy | Daily | [solution](<_1598. Crawler Log Folder.md>) | c, js | Jul 10, 2024 |
1011
| 1701 | [Average Waiting Time](<https://leetcode.com/problems/average-waiting-time>) | Medium | Daily | [solution](<_1701. Average Waiting Time.md>) | js, py | Jul 09, 2024 |
1112
| 1823 | [Find the Winner of the Circular Game](<https://leetcode.com/problems/find-the-winner-of-the-circular-game>) | Medium | Daily | [solution](<_1823. Find the Winner of the Circular Game.md>) | c, cpp, java, js, py | Jul 08, 2024 |

markdowns/Questions_By_Code_Length.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,7 @@ Calculations are based on the code files's byte sizes.
347347
| 663 | [Equal Tree Partition](<https://leetcode.com/problems/equal-tree-partition>) | Medium | Daily | [solution](<_663. Equal Tree Partition.md>) | py | Jun 17, 2024 |
348348
| 930 | [Binary Subarrays With Sum](<https://leetcode.com/problems/binary-subarrays-with-sum>) | Medium | | [solution](<_930. Binary Subarrays With Sum.md>) | py | Jun 22, 2024 |
349349
| 3110 | [Score of a String](<https://leetcode.com/problems/score-of-a-string>) | Easy | Daily | [solution](<_3110. Score of a String.md>) | java, py | Jun 01, 2024 |
350+
| 1190 | [Reverse Substrings Between Each Pair of Parentheses](<https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses>) | Medium | Daily | [solution](<_1190. Reverse Substrings Between Each Pair of Parentheses.md>) | py | Jul 11, 2024 |
350351
| 189 | [Rotate Array](<https://leetcode.com/problems/rotate-array>) | Medium | | [solution](<_189. Rotate Array.md>) | py | Jun 02, 2024 |
351352
| 121 | [Best Time to Buy and Sell Stock](<https://leetcode.com/problems/best-time-to-buy-and-sell-stock>) | Easy | B75, N150 | [solution](<_121. Best Time to Buy and Sell Stock.md>) | py | Jul 03, 2024 |
352353
| 2545 | [Sort the Students by Their Kth Score](<https://leetcode.com/problems/sort-the-students-by-their-kth-score>) | Medium | | [solution](<_2545. Sort the Students by Their Kth Score.md>) | java, py | Jun 24, 2024 |

markdowns/Questions_By_Recent.md

Lines changed: 1 addition & 0 deletions
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+
| 1190 | [Reverse Substrings Between Each Pair of Parentheses](<https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses>) | Medium | Daily | [solution](<_1190. Reverse Substrings Between Each Pair of Parentheses.md>) | py | Jul 11, 2024 |
910
| 2619 | [Array Prototype Last](<https://leetcode.com/problems/array-prototype-last>) | Easy | | [solution](<_2619. Array Prototype Last.md>) | js | Jul 10, 2024 |
1011
| 1598 | [Crawler Log Folder](<https://leetcode.com/problems/crawler-log-folder>) | Easy | Daily | [solution](<_1598. Crawler Log Folder.md>) | c, js | Jul 10, 2024 |
1112
| 2796 | [Repeat String](<https://leetcode.com/problems/repeat-string>) | Easy | | [solution](<_2796. Repeat String.md>) | js | Jul 09, 2024 |

markdowns/Topics.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- [Array](<by_topic/Array.md>) (193 completed)
88
- [Hash Table](<by_topic/Hash Table.md>) (92 completed)
9-
- [String](<by_topic/String.md>) (89 completed)
9+
- [String](<by_topic/String.md>) (90 completed)
1010
- [Depth-First Search](<by_topic/Depth-First Search.md>) (68 completed)
1111
- [Tree](<by_topic/Tree.md>) (66 completed)
1212
- [Binary Tree](<by_topic/Binary Tree.md>) (61 completed)
@@ -15,7 +15,7 @@
1515
- [Breadth-First Search](<by_topic/Breadth-First Search.md>) (47 completed)
1616
- [Two Pointers](<by_topic/Two Pointers.md>) (46 completed)
1717
- [Linked List](<by_topic/Linked List.md>) (40 completed)
18-
- [Stack](<by_topic/Stack.md>) (38 completed)
18+
- [Stack](<by_topic/Stack.md>) (39 completed)
1919
- [Greedy](<by_topic/Greedy.md>) (32 completed)
2020
- [Matrix](<by_topic/Matrix.md>) (31 completed)
2121
- [Simulation](<by_topic/Simulation.md>) (29 completed)
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# 1190. [Reverse Substrings Between Each Pair of Parentheses](<https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses>)
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 : July 11, 2024*
10+
>
11+
> *Last updated : July 11, 2024*
12+
13+
------
14+
15+
> **Related Topics** : **[String](<by_topic/String.md>), [Stack](<by_topic/Stack.md>)**
16+
>
17+
> **Acceptance Rate** : **66.5 %**
18+
19+
------
20+
21+
## Solutions
22+
23+
- [m1190 Daily.py](<../my-submissions/m1190 Daily.py>)
24+
### Python
25+
#### [m1190 Daily.py](<../my-submissions/m1190 Daily.py>)
26+
```Python
27+
class Solution:
28+
def reverseParentheses(self, s: str) -> str:
29+
openingIndices = []
30+
indx = 0
31+
output = list(s)
32+
33+
for indx, c in enumerate(s) :
34+
if c == '(' :
35+
openingIndices.append(indx)
36+
elif c == ')' :
37+
lastOpen = openingIndices.pop()
38+
output[lastOpen + 1 : indx] = reversed(output[lastOpen + 1 : indx])
39+
40+
return ''.join([x for x in output if x != '(' and x != ')'])
41+
```
42+

markdowns/by_topic/Stack.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [Stack](<https://leetcode.com/tag/Stack/>) (38 completed)
1+
# [Stack](<https://leetcode.com/tag/Stack/>) (39 completed)
22

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

@@ -32,6 +32,7 @@
3232
| 1006 | [Clumsy Factorial](<https://leetcode.com/problems/clumsy-factorial>) | Medium | | [solution](<../_1006. Clumsy Factorial.md>) | c, py | Jun 12, 2024 |
3333
| 1008 | [Construct Binary Search Tree from Preorder Traversal](<https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal>) | Medium | | [solution](<../_1008. Construct Binary Search Tree from Preorder Traversal.md>) | c, cpp, java | Jun 27, 2024 |
3434
| 1019 | [Next Greater Node In Linked List](<https://leetcode.com/problems/next-greater-node-in-linked-list>) | Medium | | [solution](<../_1019. Next Greater Node In Linked List.md>) | py | Jun 22, 2024 |
35+
| 1190 | [Reverse Substrings Between Each Pair of Parentheses](<https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses>) | Medium | Daily | [solution](<../_1190. Reverse Substrings Between Each Pair of Parentheses.md>) | py | Jul 11, 2024 |
3536
| 1209 | [Remove All Adjacent Duplicates in String II](<https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii>) | Medium | | [solution](<../_1209. Remove All Adjacent Duplicates in String II.md>) | py | Jun 19, 2024 |
3637
| 1249 | [Minimum Remove to Make Valid Parentheses](<https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses>) | Medium | | [solution](<../_1249. Minimum Remove to Make Valid Parentheses.md>) | py | Jun 10, 2024 |
3738
| 1265 | [Print Immutable Linked List in Reverse](<https://leetcode.com/problems/print-immutable-linked-list-in-reverse>) | Medium | | [solution](<../_1265. Print Immutable Linked List in Reverse.md>) | c, py | Jun 06, 2024 |

markdowns/by_topic/String.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [String](<https://leetcode.com/tag/String/>) (89 completed)
1+
# [String](<https://leetcode.com/tag/String/>) (90 completed)
22

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

@@ -56,6 +56,7 @@
5656
| 1028 | [Recover a Tree From Preorder Traversal](<https://leetcode.com/problems/recover-a-tree-from-preorder-traversal>) | Hard | | [solution](<../_1028. Recover a Tree From Preorder Traversal.md>) | py | Jul 01, 2024 |
5757
| 1087 | [Brace Expansion](<https://leetcode.com/problems/brace-expansion>) | Medium | | [solution](<../_1087. Brace Expansion.md>) | py | Jun 15, 2024 |
5858
| 1166 | [Design File System](<https://leetcode.com/problems/design-file-system>) | Medium | | [solution](<../_1166. Design File System.md>) | py | Jun 28, 2024 |
59+
| 1190 | [Reverse Substrings Between Each Pair of Parentheses](<https://leetcode.com/problems/reverse-substrings-between-each-pair-of-parentheses>) | Medium | Daily | [solution](<../_1190. Reverse Substrings Between Each Pair of Parentheses.md>) | py | Jul 11, 2024 |
5960
| 1209 | [Remove All Adjacent Duplicates in String II](<https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string-ii>) | Medium | | [solution](<../_1209. Remove All Adjacent Duplicates in String II.md>) | py | Jun 19, 2024 |
6061
| 1233 | [Remove Sub-Folders from the Filesystem](<https://leetcode.com/problems/remove-sub-folders-from-the-filesystem>) | Medium | | [solution](<../_1233. Remove Sub-Folders from the Filesystem.md>) | py | Jun 28, 2024 |
6162
| 1239 | [Maximum Length of a Concatenated String with Unique Characters](<https://leetcode.com/problems/maximum-length-of-a-concatenated-string-with-unique-characters>) | Medium | | [solution](<../_1239. Maximum Length of a Concatenated String with Unique Characters.md>) | py | Jun 29, 2024 |

0 commit comments

Comments
 (0)