diff --git a/.generate/TEMPLATE.j2 b/.generate/TEMPLATE.j2 index 33a0996..53bac0d 100644 --- a/.generate/TEMPLATE.j2 +++ b/.generate/TEMPLATE.j2 @@ -1,5 +1,9 @@ # leetcode +This repository contains my solutions to various problems on [LeetCode](https://leetcode.com/). + +Below is the full table containing all the problems I have solved so far. The table is [automatically generated](./.generate/main.py). + {{ table }} diff --git a/.generate/main.py b/.generate/main.py index f2dd264..173729b 100755 --- a/.generate/main.py +++ b/.generate/main.py @@ -82,9 +82,11 @@ def main(): for solution in meta["solutions"] ) - if len(solutions) > 15: + # The length of the solution name + 2 characters to join the solutions together (minus the last one) + space_used: int = sum(len(solution["name"] ) for solution in meta["solutions"]) + (len(meta["solutions"]) - 1) * 2 + if space_used > 30: logger.warning( - f"Solution '{question.title}' has a long list of solutions ({len(solutions)})." + f"Solution '{question.title}' has a long list of solutions ({space_used})." ) columns = [ diff --git a/README.md b/README.md index 75b0eb6..ffc1271 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # leetcode +This repository contains my solutions to various problems on [LeetCode](https://leetcode.com/). + +Below is the full table containing all the problems I have solved so far. The table is [automatically generated](./.generate/main.py). + | # | Title | Solution | Difficulty | |-|-|-|-| | [8](https://leetcode.com/problems/string-to-integer-atoi) | [String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi) | [Java](/solutions/string-to-integer-atoi/Solution.java) | Medium |