Skip to content

Commit caa79e2

Browse files
committed
scaling feature
1 parent f8bf5e7 commit caa79e2

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@ My clean, typed, and tested solutions to LeetCode problems (Python 3.10+).
1111

1212
<!-- START_TABLE -->
1313
## Problems
14+
<details>
15+
<summary><b> Show all solved problems (4)</b>></summary>
16+
1417
| # | Title | Difficulty | Solution |
1518
|---|-------|------------|----------|
1619
| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | Easy | [`two_sum_0001.py`](solutions/two_sum_0001.py) |
1720
| 9 | [Palindrome Number](https://leetcode.com/problems/palindrome-number/) | Easy | [`palindrome_number_0009.py`](solutions/palindrome_number_0009.py) |
1821
| 12 | [Integer to Roman](https://leetcode.com/problems/integer-to-roman/) | Medium | [`integer_to_roman_0012.py`](solutions/integer_to_roman_0012.py) |
1922
| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | Easy | [`roman_to_integer_0013.py`](solutions/roman_to_integer_0013.py) |
20-
| 83 | [Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) | Easy | [`remove_duplicates_from_sorted_list_0083.py`](solutions/remove_duplicates_from_sorted_list_0083.py) |
23+
24+
</details>
2125
<!-- END_TABLE -->
2226

2327
<hr>

scripts/update_readme.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ def main():
145145
else:
146146
table_md = '| — | — | — | — |'
147147

148+
table_with_details = (
149+
f'<details>\n<summary><b> Show all solved problems ({total_solved})</b></summary>\n'
150+
'## Problems\n\n'
151+
'| # | Title | Difficulty | Solution |\n'
152+
'|---|-------|------------|----------|\n'
153+
f'{table_md}\n'
154+
'</details>'
155+
)
156+
148157
with open(readme_path, 'r') as f:
149158
content = f.read()
150159

@@ -156,7 +165,7 @@ def main():
156165
)
157166
content = re.sub(
158167
r'(<!-- START_TABLE -->\n).*?(<!-- END_TABLE -->)',
159-
f'<!-- START_TABLE -->\n## Problems\n| # | Title | Difficulty | Solution |\n|---|-------|------------|----------|\n{table_md}\n<!-- END_TABLE -->',
168+
f'<!-- START_TABLE -->\n{table_with_details}\n<!-- END_TABLE -->',
160169
content,
161170
flags=re.DOTALL
162171
)

0 commit comments

Comments
 (0)