Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This README is generated using the following custom-built **Python** scripts: [`
***

## Progress Overview
![LeetCode stats](lc_chart.png?)
![LeetCode stats](.github/lc_chart.png?)

## Solutions Directory
|ID|Difficulty|Type|Title|Solutions|
Expand Down
9 changes: 6 additions & 3 deletions scripts/lc_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import lc_constants as lcc
import matplotlib.pyplot as plt
import numpy as np
import pathlib as pl


def chart_leetcode() -> None:
Expand Down Expand Up @@ -61,9 +62,11 @@ def chart_leetcode() -> None:
axes.set_title("Number of LeetCode solutions by language and level")
axes.legend()

chart_name = "lc_chart"
plt.savefig(chart_name)
print(f"[SUCCESS] Chart image '{chart_name}.png' generated (total number of solutions: {int(totals[-1])})")
script_path = pl.Path(__file__).resolve()
chart_path = script_path.parent.parent / ".github" / "lc_chart.png"

plt.savefig(chart_path)
print(f"[SUCCESS] Chart image generated in .github folder (total number of solutions: {int(totals[-1])})")


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion scripts/lc_constants.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
REETKODE_SOLUTION_URL = "{folder}/{filename}"
REETKODE_ICON_URL = ".github/icons/{icon}"
REETKODE_CHART_URL = "lc_chart.png?"
REETKODE_CHART_URL = ".github/lc_chart.png?"
LEETCODE_PROBLEM_URL = "https://lcid.cc/{id}"

IGNORED_DIRS = (".git", ".github", "icons", "scripts")
Expand Down