mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 05:21:49 +03:00
feat: Add LeetCode directory writer (#1187)
* add leetcode_directory_writer * updating DIRECTORY.md * Update leetcode_directory_md.py add script header * updating DIRECTORY.md * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: David Leal <halfpacho@gmail.com> * updating DIRECTORY.md * updating DIRECTORY.md * Update .github/workflows/leetcode_directory_writer.yml Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * Update scripts/leetcode_directory_md.py Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * Update scripts/leetcode_directory_md.py Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * Update scripts/leetcode_directory_md.py Co-authored-by: Taj <tjgurwara99@users.noreply.github.com> * fix formating * updating DIRECTORY.md * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: David Leal <halfpacho@gmail.com> Co-authored-by: github-actions[bot] <github-actions@users.noreply.github.com> Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
This commit is contained in:
parent
74ef8f5806
commit
90d7d81807
30
.github/workflows/leetcode_directory_writer.yml
vendored
Normal file
30
.github/workflows/leetcode_directory_writer.yml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
# The objective of this GitHub Action is to update the leetcode DIRECTORY.md file (if needed)
|
||||
# when doing a git push
|
||||
name: leetcode_directory_writer
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "leetcode/src/**.c"
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
- name: Add python dependencies
|
||||
run: |
|
||||
pip install requests
|
||||
- name: Write leectode DIRECTORY.md
|
||||
run: |
|
||||
python3 scripts/leetcode_directory_md.py 2>&1 | tee leetcode/DIRECTORY.md
|
||||
git config --global user.name github-actions[bot]
|
||||
git config --global user.email 'github-actions@users.noreply.github.com'
|
||||
- name: Update LeetCode's directory
|
||||
run: |
|
||||
git add leetcode/DIRECTORY.md
|
||||
git commit -am "updating DIRECTORY.md" || true
|
||||
git push origin HEAD:$GITHUB_REF || true
|
@ -1,138 +1,144 @@
|
||||
|
||||
# LeetCode
|
||||
|
||||
### LeetCode Algorithm
|
||||
|
||||
| # | Title | Solution | Difficulty |
|
||||
| ---- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------- | ---------- |
|
||||
| 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [C](./src/1.c) | Easy |
|
||||
| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [C](./src/2.c) | Medium |
|
||||
| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [C](./src/3.c) | Medium |
|
||||
| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [C](./src/4.c) | Hard |
|
||||
| 6 | [ZigZag conversion](https://leetcode.com/problems/zigzag-conversion/) | [C](./src/4.c) | Medium |
|
||||
| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer/) | [C](./src/7.c) | Easy |
|
||||
| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi) | [C](./src/8.c) | Medium |
|
||||
| 9 | [Palindrome Number](https://leetcode.com/problems/palindrome-number/) | [C](./src/9.c) | Easy |
|
||||
| 10 | [Regular Expression Matching](https://leetcode.com/problems/regular-expression-matching/) | [C](./src/10.c) | Hard |
|
||||
| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water/) | [C](./src/11.c) | Medium |
|
||||
| 12 | [Integer to Roman](https://leetcode.com/problems/integer-to-roman) | [C](./src/12.c) | Medium |
|
||||
| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer/) | [C](./src/13.c) | Easy |
|
||||
| 14 | [Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones/) | [C](./src/14.c) | Easy |
|
||||
| 20 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | [C](./src/20.c) | Easy |
|
||||
| 21 | [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/) | [C](./src/21.c) | Easy |
|
||||
| 24 | [Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [C](./src/24.c) | Medium |
|
||||
| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [C](./src/26.c) | Easy |
|
||||
| 27 | [Remove Element](https://leetcode.com/problems/remove-element/) | [C](./src/27.c) | Easy |
|
||||
| 28 | [Implement strStr()](https://leetcode.com/problems/implement-strstr/) | [C](./src/28.c) | Easy |
|
||||
| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers/) | [C](./src/29.c) | Medium |
|
||||
| 32 | [Longest Valid Parentheses](https://leetcode.com/problems/longest-valid-parentheses/) | [C](./src/32.c) | Hard |
|
||||
| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position/) | [C](./src/35.c) | Easy |
|
||||
| 37 | [Sudoku Solver](https://leetcode.com/problems/sudoku-solver/) | [C](./src/37.c) | Hard |
|
||||
| 38 | [Count and Say](https://leetcode.com/problems/count-and-say/) | [C](./src/38.c) | Easy |
|
||||
| 42 | [Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water/) | [C](./src/42.c) | Hard |
|
||||
| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray/) | [C](./src/53.c) | Easy |
|
||||
| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths/description/) | [C](./src/62.c) | Medium |
|
||||
| 66 | [Plus One](https://leetcode.com/problems/plus-one/) | [C](./src/66.c) | Easy |
|
||||
| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors/) | [C](./src/75.c) | Medium |
|
||||
| 79 | [Word Search](https://leetcode.com/problems/word-search/) | [C](./src/79.c) | Medium |
|
||||
| 82 | [Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii/) | [C](./src/82.c) | Medium |
|
||||
| 83 | [Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list/) | [C](./src/83.c) | Easy |
|
||||
| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal/) | [C](./src/94.c) | Medium |
|
||||
| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree/) | [C](./src/98.c) | Medium |
|
||||
| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree/) | [C](./src/101.c) | Easy |
|
||||
| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/) | [C](./src/104.c) | Easy |
|
||||
| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/) | [C](./src/108.c) | Easy |
|
||||
| 109 | [Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree/) | [C](./src/109.c) | Medium |
|
||||
| 110 | [Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree/) | [C](./src/110.c) | Easy |
|
||||
| 112 | [Path Sum](https://leetcode.com/problems/path-sum/) | [C](./src/112.c) | Easy |
|
||||
| 118 | [Pascal's Triangle](https://leetcode.com/problems/pascals-triangle/) | [C](./src/118.c) | Easy |
|
||||
| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock/) | [C](./src/121.c) | Easy |
|
||||
| 124 | [Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum/description/) | [C](./src/124.c) | Hard |
|
||||
| 125 | [Valid Palindrome](https://leetcode.com/problems/valid-palindrome/) | [C](./src/125.c) | Easy |
|
||||
| 136 | [Single Number](https://leetcode.com/problems/single-number/) | [C](./src/136.c) | Easy |
|
||||
| 141 | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle/) | [C](./src/141.c) | Easy |
|
||||
| 142 | [Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii/) | [C](./src/142.c) | Medium |
|
||||
| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array/) | [C](./src/153.c) | Medium |
|
||||
| 160 | [Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/) | [C](./src/160.c) | Easy |
|
||||
| 169 | [Majority Element](https://leetcode.com/problems/majority-element/) | [C](./src/169.c) | Easy |
|
||||
| 173 | [Binary Search Tree Iterator](https://leetcode.com/problems/binary-search-tree-iterator/) | [C](./src/173.c) | Medium |
|
||||
| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array) | [C](./src/189.c) | Easy |
|
||||
| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits/) | [C](./src/190.c) | Easy |
|
||||
| 191 | [Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/) | [C](./src/191.c) | Easy |
|
||||
| 201 | [Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range/) | [C](./src/201.c) | Medium |
|
||||
| 203 | [Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements/) | [C](./src/203.c) | Easy |
|
||||
| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list/) | [C](./src/206.c) | Easy |
|
||||
| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array/) | [C](./src/215.c) | Medium |
|
||||
| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate/) | [C](./src/217.c) | Easy |
|
||||
| 223 | [Rectangle Area](https://leetcode.com/problems/rectangle-area/) | [C](./src/223.c) | Medium |
|
||||
| 226 | [Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree/) | [C](./src/226.c) | Easy |
|
||||
| 230 | [Kth Smallest Element in a BST](https://leetcode.com/problems/kth-smallest-element-in-a-bst/) | [C](./src/230.c) | Medium |
|
||||
| 231 | [Power of Two](https://leetcode.com/problems/power-of-two/) | [C](./src/231.c) | Easy |
|
||||
| 234 | [Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list/) | [C](./src/234.c) | Easy |
|
||||
| 236 | [Lowest Common Ancestor of a Binary Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/) | [C](./src/236.c) | Medium |
|
||||
| 242 | [Valid Anagram](https://leetcode.com/problems/valid-anagram/) | [C](./src/242.c) | Easy |
|
||||
| 268 | [Missing Number](https://leetcode.com/problems/missing-number/) | [C](./src/268.c) | Easy |
|
||||
| 274 | [H-Index](https://leetcode.com/problems/h-index/description/) | [C](./src/274.c) | Medium |
|
||||
| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version/) | [C](./src/278.c) | Easy |
|
||||
| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes/) | [C](./src/283.c) | Easy |
|
||||
| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number/) | [C](./src/287.c) | Medium |
|
||||
| 344 | [Reverse String](https://leetcode.com/problems/reverse-string/) | [C](./src/344.c) | Easy |
|
||||
| 367 | [Valid Perfect Square](https://leetcode.com/problems/valid-perfect-square/) | [C](./src/367.c) | Easy |
|
||||
| 387 | [First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string/) | [C](./src/387.c) | Easy |
|
||||
| 389 | [Find the Difference](https://leetcode.com/problems/find-the-difference/) | [C](./src/389.c) | Easy |
|
||||
| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves/) | [C](./src/404.c) | Easy |
|
||||
| 442 | [Find All Duplicates in an Array](https://leetcode.com/problems/find-all-duplicates-in-an-array/) | [C](./src/442.c) | Medium |
|
||||
| 461 | [Hamming Distance](https://leetcode.com/problems/hamming-distance/) | [C](./src/461.c) | Easy |
|
||||
| 476 | [Number Complement](https://leetcode.com/problems/number-complement/) | [C](./src/476.c) | Easy |
|
||||
| 509 | [Fibonacci Number](https://leetcode.com/problems/fibonacci-number/) | [C](./src/509.c) | Easy |
|
||||
| 520 | [Detect Capital](https://leetcode.com/problems/detect-capital/) | [C](./src/520.c) | Easy |
|
||||
| 561 | [Array Partition I](https://leetcode.com/problems/array-partition-i/) | [C](./src/561.c) | Easy |
|
||||
| 617 | [Merge Two Binary Trees](https://leetcode.com/problems/merge-two-binary-trees/) | [C](./src/617.c) | Easy |
|
||||
| 647 | [Palindromic Substring](https://leetcode.com/problems/palindromic-substrings/) | [C](./src/647.c) | Medium |
|
||||
| 669 | [Trim a Binary Search Tree](https://leetcode.com/problems/trim-a-binary-search-tree/) | [C](./src/669.c) | Medium |
|
||||
| 674 | [Longest Continuous Increasing Subsequence](https://leetcode.com/problems/longest-continuous-increasing-subsequence/) | [C](./src/674.c) | Easy |
|
||||
| 684 | [Redundant Connection](https://leetcode.com/problems/redundant-connection/description/) | [C](./src/684.c) | Medium |
|
||||
| 700 | [Search in a Binary Search Tree](https://leetcode.com/problems/search-in-a-binary-search-tree/) | [C](./src/700.c) | Easy |
|
||||
| 701 | [Insert into a Binary Search Tree](https://leetcode.com/problems/insert-into-a-binary-search-tree/) | [C](./src/701.c) | Medium |
|
||||
| 704 | [Binary Search](https://leetcode.com/problems/binary-search/) | [C](./src/704.c) | Easy |
|
||||
| 709 | [To Lower Case](https://leetcode.com/problems/to-lower-case/) | [C](./src/709.c) | Easy |
|
||||
| 771 | [Jewels and Stones](https://leetcode.com/problems/jewels-and-stones/) | [C](./src/771.c) | Easy |
|
||||
| 807 | [Max Increase to Keep City Skyline](https://leetcode.com/problems/max-increase-to-keep-city-skyline/description/) | [C](./src/807.c) | Medium |
|
||||
| 841 | [Keys and Rooms](https://leetcode.com/problems/keys-and-rooms/description/) | [C](./src/841.c) | Medium |
|
||||
| 852 | [Peak Index in a Mountain Array](https://leetcode.com/problems/peak-index-in-a-mountain-array/) | [C](./src/852.c) | Easy |
|
||||
| 876 | [Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list/) | [C](./src/876.c) | Easy |
|
||||
| 901 | [Online Stock Span](https://leetcode.com/problems/online-stock-span/) | [C](./src/901.c) | Medium |
|
||||
| 905 | [Sort Array By Parity](https://leetcode.com/problems/sort-array-by-parity/) | [C](./src/905.c) | Easy |
|
||||
| 917 | [Reverse Only Letters](https://leetcode.com/problems/reverse-only-letters/) | [C](./src/917.c) | Easy |
|
||||
| 931 | [Minimum Falling Path Sum](https://leetcode.com/problems/minimum-falling-path-sum/description/) | [C](./src/931.c) | Medium |
|
||||
| 938 | [Range Sum of BST](https://leetcode.com/problems/range-sum-of-bst/) | [C](./src/938.c) | Easy |
|
||||
| 965 | [Univalued Binary Tree](https://leetcode.com/problems/univalued-binary-tree/) | [C](./src/965.c) | Easy |
|
||||
| 977 | [Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array/) | [C](./src/977.c) | Easy |
|
||||
| 985 | [Sum of Even Numbers After Queries](https://leetcode.com/problems/sum-of-even-numbers-after-queries/) | [C](./src/985.c) | Medium |
|
||||
| 1009 | [Complement of Base 10 Integer](https://leetcode.com/problems/complement-of-base-10-integer/) | [C](./src/1009.c) | Easy |
|
||||
| 1026 | [Maximum Difference Between Node and Ancestor](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor/description/) | [C](./src/1026.c) | Medium |
|
||||
| 1089 | [Duplicate Zeros](https://leetcode.com/problems/duplicate-zeros/) | [C](./src/1089.c) | Easy |
|
||||
| 1147 | [Longest Chunked Palindrome Decomposition](https://leetcode.com/problems/longest-chunked-palindrome-decomposition/description/) | [C](./src/1147.c) | Hard |
|
||||
| 1184 | [Distance Between Bus Stops](https://leetcode.com/problems/distance-between-bus-stops/) | [C](./src/1184.c) | Easy |
|
||||
| 1189 | [Maximum Number of Balloons](https://leetcode.com/problems/maximum-number-of-balloons/) | [C](./src/1189.c) | Easy |
|
||||
| 1207 | [Unique Number of Occurrences](https://leetcode.com/problems/unique-number-of-occurrences/) | [C](./src/1207.c) | Easy |
|
||||
| 1283 | [Find the Smallest Divisor Given a Threshold]https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold/description/) | [C](./src/1283.c) | Medium |
|
||||
| 1657 | [Determine if Two Strings Are Close](https://leetcode.com/problems/determine-if-two-strings-are-close/description/) | [C](./src/1657.c) | Medium |
|
||||
| 1695 | [Maximum Erasure Value](https://leetcode.com/problems/maximum-erasure-value/) | [C](./src/1695.c) | Medium |
|
||||
| 1769 | [Minimum Number of Operations to Move All Balls to Each Box](https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box/) | [C](./src/1769.c) | Medium |
|
||||
| 1524 | [Number of Sub-arrays With Odd Sum](https://leetcode.com/problems/number-of-sub-arrays-with-odd-sum/) | [C](./src/1524.c) | Medium |
|
||||
| 1653 | [Minimum Deletions to Make String Balanced](https://leetcode.com/problems/minimum-deletions-to-make-string-balanced/) | [C](./src/1653.c) | Medium |
|
||||
| 1704 | [Determine if String Halves Are Alike](Determine if String Halves Are Alike) | [C](./src/1704.c) | Easy |
|
||||
| 1838 | [Frequency of the Most Frequent Element](https://leetcode.com/problems/frequency-of-the-most-frequent-element/) | [C](./src/1838.c) | Medium |
|
||||
| 1752 | [Check if Array Is Sorted and Rotated](https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/) | [C](./src/1752.c) | Easy |
|
||||
| 1833 | [Maximum Ice Cream Bars](https://leetcode.com/problems/maximum-ice-cream-bars/) | [C](./src/1833.c) | Medium |
|
||||
| 2024 | [Maximize the Confusion of an Exam](https://leetcode.com/problems/maximize-the-confusion-of-an-exam/) | [C](./src/2024.c) | Medium |
|
||||
| 2095 | [Delete the Middle Node of a Linked List](https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list/) | [C](./src/2095.c) | Medium |
|
||||
| 2125 | [Number of Laser Beams in a Bank](https://leetcode.com/problems/number-of-laser-beams-in-a-bank/description/) | [C](./src/2125.c) | Medium |
|
||||
| 2130 | [Maximum Twin Sum of a Linked List](https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list/) | [C](./src/2130.c) | Medium |
|
||||
| 2222 | [Number of Ways to Select Buildings](https://leetcode.com/problems/number-of-ways-to-select-buildings/) | [C](./src/2222.c) | Medium |
|
||||
| 2256 | [Minimum Average Difference](https://leetcode.com/problems/minimum-average-difference/) | [C](./src/2256.c) | Medium |
|
||||
| 2270 | [Number of Ways to Split Array](https://leetcode.com/problems/number-of-ways-to-split-array/) | [C](./src/2270.c) | Medium |
|
||||
| 2279 | [Maximum Bags With Full Capacity of Rocks](https://leetcode.com/problems/maximum-bags-with-full-capacity-of-rocks/) | [C](./src/2279.c) | Medium |
|
||||
| 2304 | [Minimum Path Cost in a Grid](https://leetcode.com/problems/minimum-path-cost-in-a-grid/) | [C](./src/2304.c) | Medium |
|
||||
| 2482 | [Difference Between Ones and Zeros in Row and Column](https://leetcode.com/problems/difference-between-ones-and-zeros-in-row-and-column/description/) | [C](./src/2482.c) | Medium |
|
||||
| 2501 | [Longest Square Streak in an Array](https://leetcode.com/problems/longest-square-streak-in-an-array/description/) | [C](./src/2501.c) | Medium |
|
||||
| # | Title | Solution | Difficulty |
|
||||
| ----| ------------------------------------------------------------------------------------------------------------------------------------------------------| ----------------- | ---------- |
|
||||
| 1 | [Two Sum](https://leetcode.com/problems/two-sum) | [C](./src/1.c) | Easy |
|
||||
| 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers) | [C](./src/2.c) | Medium |
|
||||
| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters) | [C](./src/3.c) | Medium |
|
||||
| 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays) | [C](./src/4.c) | Hard |
|
||||
| 6 | [Zigzag Conversion](https://leetcode.com/problems/zigzag-conversion) | [C](./src/6.c) | Medium |
|
||||
| 7 | [Reverse Integer](https://leetcode.com/problems/reverse-integer) | [C](./src/7.c) | Medium |
|
||||
| 8 | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi) | [C](./src/8.c) | Medium |
|
||||
| 9 | [Palindrome Number](https://leetcode.com/problems/palindrome-number) | [C](./src/9.c) | Easy |
|
||||
| 10 | [Regular Expression Matching](https://leetcode.com/problems/regular-expression-matching) | [C](./src/10.c) | Hard |
|
||||
| 11 | [Container With Most Water](https://leetcode.com/problems/container-with-most-water) | [C](./src/11.c) | Medium |
|
||||
| 12 | [Integer to Roman](https://leetcode.com/problems/integer-to-roman) | [C](./src/12.c) | Medium |
|
||||
| 13 | [Roman to Integer](https://leetcode.com/problems/roman-to-integer) | [C](./src/13.c) | Easy |
|
||||
| 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix) | [C](./src/14.c) | Easy |
|
||||
| 20 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses) | [C](./src/20.c) | Easy |
|
||||
| 21 | [Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists) | [C](./src/21.c) | Easy |
|
||||
| 24 | [Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs) | [C](./src/24.c) | Medium |
|
||||
| 26 | [Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array) | [C](./src/26.c) | Easy |
|
||||
| 27 | [Remove Element](https://leetcode.com/problems/remove-element) | [C](./src/27.c) | Easy |
|
||||
| 28 | [Find the Index of the First Occurrence in a String](https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string) | [C](./src/28.c) | Medium |
|
||||
| 29 | [Divide Two Integers](https://leetcode.com/problems/divide-two-integers) | [C](./src/29.c) | Medium |
|
||||
| 32 | [Longest Valid Parentheses](https://leetcode.com/problems/longest-valid-parentheses) | [C](./src/32.c) | Hard |
|
||||
| 35 | [Search Insert Position](https://leetcode.com/problems/search-insert-position) | [C](./src/35.c) | Easy |
|
||||
| 37 | [Sudoku Solver](https://leetcode.com/problems/sudoku-solver) | [C](./src/37.c) | Hard |
|
||||
| 38 | [Count and Say](https://leetcode.com/problems/count-and-say) | [C](./src/38.c) | Medium |
|
||||
| 42 | [Trapping Rain Water](https://leetcode.com/problems/trapping-rain-water) | [C](./src/42.c) | Hard |
|
||||
| 53 | [Maximum Subarray](https://leetcode.com/problems/maximum-subarray) | [C](./src/53.c) | Medium |
|
||||
| 62 | [Unique Paths](https://leetcode.com/problems/unique-paths) | [C](./src/62.c) | Medium |
|
||||
| 63 | [Unique Paths II](https://leetcode.com/problems/unique-paths-ii) | [C](./src/63.c) | Medium |
|
||||
| 66 | [Plus One](https://leetcode.com/problems/plus-one) | [C](./src/66.c) | Easy |
|
||||
| 75 | [Sort Colors](https://leetcode.com/problems/sort-colors) | [C](./src/75.c) | Medium |
|
||||
| 79 | [Word Search](https://leetcode.com/problems/word-search) | [C](./src/79.c) | Medium |
|
||||
| 82 | [Remove Duplicates from Sorted List II](https://leetcode.com/problems/remove-duplicates-from-sorted-list-ii) | [C](./src/82.c) | Medium |
|
||||
| 83 | [Remove Duplicates from Sorted List](https://leetcode.com/problems/remove-duplicates-from-sorted-list) | [C](./src/83.c) | Easy |
|
||||
| 94 | [Binary Tree Inorder Traversal](https://leetcode.com/problems/binary-tree-inorder-traversal) | [C](./src/94.c) | Easy |
|
||||
| 98 | [Validate Binary Search Tree](https://leetcode.com/problems/validate-binary-search-tree) | [C](./src/98.c) | Medium |
|
||||
| 101 | [Symmetric Tree](https://leetcode.com/problems/symmetric-tree) | [C](./src/101.c) | Easy |
|
||||
| 104 | [Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree) | [C](./src/104.c) | Easy |
|
||||
| 108 | [Convert Sorted Array to Binary Search Tree](https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree) | [C](./src/108.c) | Easy |
|
||||
| 109 | [Convert Sorted List to Binary Search Tree](https://leetcode.com/problems/convert-sorted-list-to-binary-search-tree) | [C](./src/109.c) | Medium |
|
||||
| 110 | [Balanced Binary Tree](https://leetcode.com/problems/balanced-binary-tree) | [C](./src/110.c) | Easy |
|
||||
| 112 | [Path Sum](https://leetcode.com/problems/path-sum) | [C](./src/112.c) | Easy |
|
||||
| 118 | [Pascal's Triangle](https://leetcode.com/problems/pascals-triangle) | [C](./src/118.c) | Easy |
|
||||
| 119 | [Pascal's Triangle II](https://leetcode.com/problems/pascals-triangle-ii) | [C](./src/119.c) | Easy |
|
||||
| 121 | [Best Time to Buy and Sell Stock](https://leetcode.com/problems/best-time-to-buy-and-sell-stock) | [C](./src/121.c) | Easy |
|
||||
| 124 | [Binary Tree Maximum Path Sum](https://leetcode.com/problems/binary-tree-maximum-path-sum) | [C](./src/124.c) | Hard |
|
||||
| 125 | [Valid Palindrome](https://leetcode.com/problems/valid-palindrome) | [C](./src/125.c) | Easy |
|
||||
| 136 | [Single Number](https://leetcode.com/problems/single-number) | [C](./src/136.c) | Easy |
|
||||
| 141 | [Linked List Cycle](https://leetcode.com/problems/linked-list-cycle) | [C](./src/141.c) | Easy |
|
||||
| 142 | [Linked List Cycle II](https://leetcode.com/problems/linked-list-cycle-ii) | [C](./src/142.c) | Medium |
|
||||
| 153 | [Find Minimum in Rotated Sorted Array](https://leetcode.com/problems/find-minimum-in-rotated-sorted-array) | [C](./src/153.c) | Medium |
|
||||
| 160 | [Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists) | [C](./src/160.c) | Easy |
|
||||
| 169 | [Majority Element](https://leetcode.com/problems/majority-element) | [C](./src/169.c) | Easy |
|
||||
| 173 | [Binary Search Tree Iterator](https://leetcode.com/problems/binary-search-tree-iterator) | [C](./src/173.c) | Medium |
|
||||
| 189 | [Rotate Array](https://leetcode.com/problems/rotate-array) | [C](./src/189.c) | Medium |
|
||||
| 190 | [Reverse Bits](https://leetcode.com/problems/reverse-bits) | [C](./src/190.c) | Easy |
|
||||
| 191 | [Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits) | [C](./src/191.c) | Easy |
|
||||
| 201 | [Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range) | [C](./src/201.c) | Medium |
|
||||
| 203 | [Remove Linked List Elements](https://leetcode.com/problems/remove-linked-list-elements) | [C](./src/203.c) | Easy |
|
||||
| 206 | [Reverse Linked List](https://leetcode.com/problems/reverse-linked-list) | [C](./src/206.c) | Easy |
|
||||
| 215 | [Kth Largest Element in an Array](https://leetcode.com/problems/kth-largest-element-in-an-array) | [C](./src/215.c) | Medium |
|
||||
| 217 | [Contains Duplicate](https://leetcode.com/problems/contains-duplicate) | [C](./src/217.c) | Easy |
|
||||
| 223 | [Rectangle Area](https://leetcode.com/problems/rectangle-area) | [C](./src/223.c) | Medium |
|
||||
| 226 | [Invert Binary Tree](https://leetcode.com/problems/invert-binary-tree) | [C](./src/226.c) | Easy |
|
||||
| 230 | [Kth Smallest Element in a BST](https://leetcode.com/problems/kth-smallest-element-in-a-bst) | [C](./src/230.c) | Medium |
|
||||
| 231 | [Power of Two](https://leetcode.com/problems/power-of-two) | [C](./src/231.c) | Easy |
|
||||
| 234 | [Palindrome Linked List](https://leetcode.com/problems/palindrome-linked-list) | [C](./src/234.c) | Easy |
|
||||
| 236 | [Lowest Common Ancestor of a Binary Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree) | [C](./src/236.c) | Medium |
|
||||
| 242 | [Valid Anagram](https://leetcode.com/problems/valid-anagram) | [C](./src/242.c) | Easy |
|
||||
| 268 | [Missing Number](https://leetcode.com/problems/missing-number) | [C](./src/268.c) | Easy |
|
||||
| 274 | [H-Index](https://leetcode.com/problems/h-index) | [C](./src/274.c) | Medium |
|
||||
| 278 | [First Bad Version](https://leetcode.com/problems/first-bad-version) | [C](./src/278.c) | Easy |
|
||||
| 283 | [Move Zeroes](https://leetcode.com/problems/move-zeroes) | [C](./src/283.c) | Easy |
|
||||
| 287 | [Find the Duplicate Number](https://leetcode.com/problems/find-the-duplicate-number) | [C](./src/287.c) | Medium |
|
||||
| 344 | [Reverse String](https://leetcode.com/problems/reverse-string) | [C](./src/344.c) | Easy |
|
||||
| 367 | [Valid Perfect Square](https://leetcode.com/problems/valid-perfect-square) | [C](./src/367.c) | Easy |
|
||||
| 387 | [First Unique Character in a String](https://leetcode.com/problems/first-unique-character-in-a-string) | [C](./src/387.c) | Easy |
|
||||
| 389 | [Find the Difference](https://leetcode.com/problems/find-the-difference) | [C](./src/389.c) | Easy |
|
||||
| 404 | [Sum of Left Leaves](https://leetcode.com/problems/sum-of-left-leaves) | [C](./src/404.c) | Easy |
|
||||
| 442 | [Find All Duplicates in an Array](https://leetcode.com/problems/find-all-duplicates-in-an-array) | [C](./src/442.c) | Medium |
|
||||
| 461 | [Hamming Distance](https://leetcode.com/problems/hamming-distance) | [C](./src/461.c) | Easy |
|
||||
| 476 | [Number Complement](https://leetcode.com/problems/number-complement) | [C](./src/476.c) | Easy |
|
||||
| 485 | [Max Consecutive Ones](https://leetcode.com/problems/max-consecutive-ones) | [C](./src/485.c) | Easy |
|
||||
| 509 | [Fibonacci Number](https://leetcode.com/problems/fibonacci-number) | [C](./src/509.c) | Easy |
|
||||
| 520 | [Detect Capital](https://leetcode.com/problems/detect-capital) | [C](./src/520.c) | Easy |
|
||||
| 561 | [Array Partition](https://leetcode.com/problems/array-partition) | [C](./src/561.c) | Easy |
|
||||
| 617 | [Merge Two Binary Trees](https://leetcode.com/problems/merge-two-binary-trees) | [C](./src/617.c) | Easy |
|
||||
| 647 | [Palindromic Substrings](https://leetcode.com/problems/palindromic-substrings) | [C](./src/647.c) | Medium |
|
||||
| 669 | [Trim a Binary Search Tree](https://leetcode.com/problems/trim-a-binary-search-tree) | [C](./src/669.c) | Medium |
|
||||
| 674 | [Longest Continuous Increasing Subsequence](https://leetcode.com/problems/longest-continuous-increasing-subsequence) | [C](./src/674.c) | Easy |
|
||||
| 684 | [Redundant Connection](https://leetcode.com/problems/redundant-connection) | [C](./src/684.c) | Medium |
|
||||
| 700 | [Search in a Binary Search Tree](https://leetcode.com/problems/search-in-a-binary-search-tree) | [C](./src/700.c) | Easy |
|
||||
| 701 | [Insert into a Binary Search Tree](https://leetcode.com/problems/insert-into-a-binary-search-tree) | [C](./src/701.c) | Medium |
|
||||
| 704 | [Binary Search](https://leetcode.com/problems/binary-search) | [C](./src/704.c) | Easy |
|
||||
| 709 | [To Lower Case](https://leetcode.com/problems/to-lower-case) | [C](./src/709.c) | Easy |
|
||||
| 771 | [Jewels and Stones](https://leetcode.com/problems/jewels-and-stones) | [C](./src/771.c) | Easy |
|
||||
| 807 | [Max Increase to Keep City Skyline](https://leetcode.com/problems/max-increase-to-keep-city-skyline) | [C](./src/807.c) | Medium |
|
||||
| 841 | [Keys and Rooms](https://leetcode.com/problems/keys-and-rooms) | [C](./src/841.c) | Medium |
|
||||
| 852 | [Peak Index in a Mountain Array](https://leetcode.com/problems/peak-index-in-a-mountain-array) | [C](./src/852.c) | Medium |
|
||||
| 876 | [Middle of the Linked List](https://leetcode.com/problems/middle-of-the-linked-list) | [C](./src/876.c) | Easy |
|
||||
| 901 | [Online Stock Span](https://leetcode.com/problems/online-stock-span) | [C](./src/901.c) | Medium |
|
||||
| 905 | [Sort Array By Parity](https://leetcode.com/problems/sort-array-by-parity) | [C](./src/905.c) | Easy |
|
||||
| 917 | [Reverse Only Letters](https://leetcode.com/problems/reverse-only-letters) | [C](./src/917.c) | Easy |
|
||||
| 931 | [Minimum Falling Path Sum](https://leetcode.com/problems/minimum-falling-path-sum) | [C](./src/931.c) | Medium |
|
||||
| 938 | [Range Sum of BST](https://leetcode.com/problems/range-sum-of-bst) | [C](./src/938.c) | Easy |
|
||||
| 965 | [Univalued Binary Tree](https://leetcode.com/problems/univalued-binary-tree) | [C](./src/965.c) | Easy |
|
||||
| 977 | [Squares of a Sorted Array](https://leetcode.com/problems/squares-of-a-sorted-array) | [C](./src/977.c) | Easy |
|
||||
| 985 | [Sum of Even Numbers After Queries](https://leetcode.com/problems/sum-of-even-numbers-after-queries) | [C](./src/985.c) | Medium |
|
||||
| 1008| [Construct Binary Search Tree from Preorder Traversal](https://leetcode.com/problems/construct-binary-search-tree-from-preorder-traversal) | [C](./src/1008.c) | Medium |
|
||||
| 1009| [Complement of Base 10 Integer](https://leetcode.com/problems/complement-of-base-10-integer) | [C](./src/1009.c) | Easy |
|
||||
| 1019| [Next Greater Node In Linked List](https://leetcode.com/problems/next-greater-node-in-linked-list) | [C](./src/1019.c) | Medium |
|
||||
| 1026| [Maximum Difference Between Node and Ancestor](https://leetcode.com/problems/maximum-difference-between-node-and-ancestor) | [C](./src/1026.c) | Medium |
|
||||
| 1089| [Duplicate Zeros](https://leetcode.com/problems/duplicate-zeros) | [C](./src/1089.c) | Easy |
|
||||
| 1147| [Longest Chunked Palindrome Decomposition](https://leetcode.com/problems/longest-chunked-palindrome-decomposition) | [C](./src/1147.c) | Hard |
|
||||
| 1184| [Distance Between Bus Stops](https://leetcode.com/problems/distance-between-bus-stops) | [C](./src/1184.c) | Easy |
|
||||
| 1189| [Maximum Number of Balloons](https://leetcode.com/problems/maximum-number-of-balloons) | [C](./src/1189.c) | Easy |
|
||||
| 1207| [Unique Number of Occurrences](https://leetcode.com/problems/unique-number-of-occurrences) | [C](./src/1207.c) | Easy |
|
||||
| 1283| [Find the Smallest Divisor Given a Threshold](https://leetcode.com/problems/find-the-smallest-divisor-given-a-threshold) | [C](./src/1283.c) | Medium |
|
||||
| 1524| [Number of Sub-arrays With Odd Sum](https://leetcode.com/problems/number-of-sub-arrays-with-odd-sum) | [C](./src/1524.c) | Medium |
|
||||
| 1653| [Minimum Deletions to Make String Balanced](https://leetcode.com/problems/minimum-deletions-to-make-string-balanced) | [C](./src/1653.c) | Medium |
|
||||
| 1657| [Determine if Two Strings Are Close](https://leetcode.com/problems/determine-if-two-strings-are-close) | [C](./src/1657.c) | Medium |
|
||||
| 1695| [Maximum Erasure Value](https://leetcode.com/problems/maximum-erasure-value) | [C](./src/1695.c) | Medium |
|
||||
| 1704| [Determine if String Halves Are Alike](https://leetcode.com/problems/determine-if-string-halves-are-alike) | [C](./src/1704.c) | Easy |
|
||||
| 1752| [Check if Array Is Sorted and Rotated](https://leetcode.com/problems/check-if-array-is-sorted-and-rotated) | [C](./src/1752.c) | Easy |
|
||||
| 1769| [Minimum Number of Operations to Move All Balls to Each Box](https://leetcode.com/problems/minimum-number-of-operations-to-move-all-balls-to-each-box)| [C](./src/1769.c) | Medium |
|
||||
| 1833| [Maximum Ice Cream Bars](https://leetcode.com/problems/maximum-ice-cream-bars) | [C](./src/1833.c) | Medium |
|
||||
| 1838| [Frequency of the Most Frequent Element](https://leetcode.com/problems/frequency-of-the-most-frequent-element) | [C](./src/1838.c) | Medium |
|
||||
| 2024| [Maximize the Confusion of an Exam](https://leetcode.com/problems/maximize-the-confusion-of-an-exam) | [C](./src/2024.c) | Medium |
|
||||
| 2095| [Delete the Middle Node of a Linked List](https://leetcode.com/problems/delete-the-middle-node-of-a-linked-list) | [C](./src/2095.c) | Medium |
|
||||
| 2125| [Number of Laser Beams in a Bank](https://leetcode.com/problems/number-of-laser-beams-in-a-bank) | [C](./src/2125.c) | Medium |
|
||||
| 2130| [Maximum Twin Sum of a Linked List](https://leetcode.com/problems/maximum-twin-sum-of-a-linked-list) | [C](./src/2130.c) | Medium |
|
||||
| 2222| [Number of Ways to Select Buildings](https://leetcode.com/problems/number-of-ways-to-select-buildings) | [C](./src/2222.c) | Medium |
|
||||
| 2256| [Minimum Average Difference](https://leetcode.com/problems/minimum-average-difference) | [C](./src/2256.c) | Medium |
|
||||
| 2270| [Number of Ways to Split Array](https://leetcode.com/problems/number-of-ways-to-split-array) | [C](./src/2270.c) | Medium |
|
||||
| 2279| [Maximum Bags With Full Capacity of Rocks](https://leetcode.com/problems/maximum-bags-with-full-capacity-of-rocks) | [C](./src/2279.c) | Medium |
|
||||
| 2304| [Minimum Path Cost in a Grid](https://leetcode.com/problems/minimum-path-cost-in-a-grid) | [C](./src/2304.c) | Medium |
|
||||
| 2482| [Difference Between Ones and Zeros in Row and Column](https://leetcode.com/problems/difference-between-ones-and-zeros-in-row-and-column) | [C](./src/2482.c) | Medium |
|
||||
| 2501| [Longest Square Streak in an Array](https://leetcode.com/problems/longest-square-streak-in-an-array) | [C](./src/2501.c) | Medium |
|
||||
|
124
scripts/leetcode_directory_md.py
Normal file
124
scripts/leetcode_directory_md.py
Normal file
@ -0,0 +1,124 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from dataclasses import dataclass
|
||||
from os import listdir
|
||||
from pathlib import Path
|
||||
|
||||
import requests
|
||||
|
||||
|
||||
@dataclass
|
||||
class Task:
|
||||
"""The task dataclass. Container for task info"""
|
||||
|
||||
id: str
|
||||
title: str
|
||||
solution: str
|
||||
difficulty: str
|
||||
|
||||
|
||||
def fetch_leetcode_folder_tasks(solutions_folder: Path) -> list[Task]:
|
||||
"""Fetch leetcode tasks from the Leetcode"""
|
||||
|
||||
# Fetch tasks info from the leetcode API.
|
||||
resp = requests.get("https://leetcode.com/api/problems/algorithms/", timeout=10)
|
||||
content_dict = resp.json()
|
||||
|
||||
raw_tasks_id_dict = {}
|
||||
|
||||
for task in content_dict["stat_status_pairs"]:
|
||||
task_stat = task["stat"]
|
||||
raw_tasks_id_dict[str(task_stat["frontend_question_id"])] = task
|
||||
|
||||
# Generate result tasks info to be inserted into the document
|
||||
tasks_list = []
|
||||
|
||||
difficulty = {1: "Easy", 2: "Medium", 3: "Hard"}
|
||||
|
||||
for fl in listdir(solutions_folder):
|
||||
task_id = fl.split(".")[0]
|
||||
|
||||
raw_task = raw_tasks_id_dict.get(task_id, None)
|
||||
if raw_task is None:
|
||||
continue
|
||||
|
||||
raw_task_stat = raw_task["stat"]
|
||||
tasks_list.append(
|
||||
Task(
|
||||
id=f'{raw_task_stat["frontend_question_id"]}',
|
||||
title=f'[{raw_task_stat["question__title"]}](https://leetcode.com/problems/{raw_task_stat["question__title_slug"]})',
|
||||
solution=f"[C](./src/{fl})",
|
||||
difficulty=f'{difficulty.get(raw_task["difficulty"]["level"], "")}',
|
||||
)
|
||||
)
|
||||
|
||||
return tasks_list
|
||||
|
||||
|
||||
HEADER_ID = "#"
|
||||
HEADER_TITLE = "Title"
|
||||
HEADER_SOLUTION = "Solution"
|
||||
HEADER_DIFFICULTY = "Difficulty"
|
||||
SEPARATOR = "-"
|
||||
|
||||
|
||||
def print_directory_md(tasks_list: list[Task]) -> None:
|
||||
"""Print tasks into the stdout"""
|
||||
|
||||
def get_max_len(get_item):
|
||||
return max(list(map(lambda x: len(get_item(x)), tasks_list)))
|
||||
|
||||
id_max_length = max(get_max_len(lambda x: x.id), len(HEADER_ID))
|
||||
title_max_length = max(get_max_len(lambda x: x.title), len(HEADER_TITLE))
|
||||
solution_max_length = max(get_max_len(lambda x: x.solution), len(HEADER_SOLUTION))
|
||||
difficulty_max_length = max(
|
||||
get_max_len(lambda x: x.difficulty), len(HEADER_DIFFICULTY)
|
||||
)
|
||||
|
||||
def formatted_string(header, title, solution, difficulty):
|
||||
return (
|
||||
f"| {header.ljust(id_max_length)}"
|
||||
+ f"| {title.ljust(title_max_length)}"
|
||||
+ f"| {solution.ljust(solution_max_length)}"
|
||||
+ f" | {difficulty.ljust(difficulty_max_length)} |"
|
||||
)
|
||||
|
||||
tasks_rows = []
|
||||
|
||||
tasks_rows.append(
|
||||
formatted_string(HEADER_ID, HEADER_TITLE, HEADER_SOLUTION, HEADER_DIFFICULTY)
|
||||
)
|
||||
tasks_rows.append(
|
||||
formatted_string(
|
||||
id_max_length * SEPARATOR,
|
||||
title_max_length * SEPARATOR,
|
||||
solution_max_length * SEPARATOR,
|
||||
difficulty_max_length * SEPARATOR,
|
||||
)
|
||||
)
|
||||
|
||||
tasks_list.sort(key=lambda x: int(x.id.strip()))
|
||||
|
||||
for task in tasks_list:
|
||||
tasks_rows.append(
|
||||
formatted_string(task.id, task.title, task.solution, task.difficulty)
|
||||
)
|
||||
|
||||
print(
|
||||
"""
|
||||
# LeetCode
|
||||
|
||||
### LeetCode Algorithm
|
||||
"""
|
||||
)
|
||||
|
||||
for item in tasks_rows:
|
||||
print(item)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
top_dir = Path(".")
|
||||
solutions_folder = top_dir / "leetcode" / "src"
|
||||
|
||||
tasks_list = fetch_leetcode_folder_tasks(solutions_folder)
|
||||
print_directory_md(tasks_list)
|
Loading…
Reference in New Issue
Block a user