Skip to content

Commit

Permalink
Merge pull request #18 from paxtonfitzpatrick/actions-urls
Browse files Browse the repository at this point in the history
update auto-generated URLs to open problems in "daily question" view
  • Loading branch information
jeremymanning authored Jul 7, 2024
2 parents ac70ccd + 9fb5eb4 commit 5e64e35
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create_new_note.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
TITLE=$(jq -r '.data.activeDailyCodingChallengeQuestion.question.title' response.json)
TITLE_SLUG=$(jq -r '.data.activeDailyCodingChallengeQuestion.question.titleSlug' response.json)
LINK="https://leetcode.com/problems/${TITLE_SLUG}"
LINK="https://leetcode.com/problems/${TITLE_SLUG}/description/?envType=daily-question"
GITHUB_USERNAME="${{ github.actor }}"
# Create problem directory and note
PROBLEM_DIR="problems/${PROBLEM_ID}"
NOTE_FILE="${PROBLEM_DIR}/${GITHUB_USERNAME}.md"
mkdir -p "${PROBLEM_DIR}"
# Customize template and write to new file
sed "s|<NUMBER>|${PROBLEM_ID}|g; s|<TITLE>|${TITLE}|g; s|<LINK TO DESCRIPTION>|${LINK}|g" problems/template.md > "${NOTE_FILE}"
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Each day (ideally) we'll attempt the daily [leetcode](https://leetcode.com) prob

| 📆 Date | ⚙️ Problem | 📝 Link to notes | 🚦 Difficulty |
|--------------|-------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------|------------|
| July 1, 2024 | [1550](https://leetcode.com/problems/three-consecutive-odds/description/) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/1550) | 🟢 Easy |
| July 2, 2024 | [350](https://leetcode.com/problems/intersection-of-two-arrays-ii/) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/350) | 🟢 Easy |
| July 3, 2024 | [1509](https://leetcode.com/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/1509) | 🟡 Medium |
| July 4, 2024 | [2181](https://leetcode.com/problems/merge-nodes-in-between-zeros/) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/2181) | 🟡 Medium |
| July 5, 2024 | [2058](https://leetcode.com/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points/) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/2058) | 🟡 Medium |
| July 6, 2024 | [2582](https://leetcode.com/problems/pass-the-pillow) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/2582) | 🟢 Easy |
| July 7, 2024 | [1518](https://leetcode.com/problems/water-bottles) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/1518) | 🟢 Easy |
| July 1, 2024 | [1550](https://leetcode.com/problems/three-consecutive-odds/description/description/?envType=daily-question) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/1550) | 🟢 Easy |
| July 2, 2024 | [350](https://leetcode.com/problems/intersection-of-two-arrays-ii/description/?envType=daily-question) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/350) | 🟢 Easy |
| July 3, 2024 | [1509](https://leetcode.com/problems/minimum-difference-between-largest-and-smallest-value-in-three-moves/description/?envType=daily-question) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/1509) | 🟡 Medium |
| July 4, 2024 | [2181](https://leetcode.com/problems/merge-nodes-in-between-zeros/description/?envType=daily-question) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/2181) | 🟡 Medium |
| July 5, 2024 | [2058](https://leetcode.com/problems/find-the-minimum-and-maximum-number-of-nodes-between-critical-points/description/?envType=daily-question) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/2058) | 🟡 Medium |
| July 6, 2024 | [2582](https://leetcode.com/problems/pass-the-pillow/description/?envType=daily-question) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/2582) | 🟢 Easy |
| July 7, 2024 | [1518](https://leetcode.com/problems/water-bottles/description/?envType=daily-question) | [Click here](https://github.com/ContextLab/leetcode-solutions/tree/main/problems/1518) | 🟢 Easy |

# Join our discussion!

Expand Down
2 changes: 1 addition & 1 deletion update_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
problem_id = problem['questionFrontendId']
title = problem['title']
title_slug = problem['titleSlug']
link = f"https://leetcode.com/problems/{title_slug}"
link = f"https://leetcode.com/problems/{title_slug}/description/?envType=daily-question"
difficulty = problem['difficulty']
difficulty_icon = "🟢" if difficulty == "Easy" else "🟡" if difficulty == "Medium" else "🔴"
note_link = f"{repo_url}/tree/main/problems/{problem_id}"
Expand Down

0 comments on commit 5e64e35

Please sign in to comment.