Skip to content

Solved LeetCode 940 using last-occurrence dynamic programming to coun… #22

Solved LeetCode 940 using last-occurrence dynamic programming to coun…

Solved LeetCode 940 using last-occurrence dynamic programming to coun… #22

name: Update LeetCode Problem List
on:
push:
branches: [main]
paths:
- "src/LeetCode/**"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed for git log dates
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: pip install requests
- name: Generate PROBLEMS.md
run: python .github/scripts/update_problems.py
- name: Commit and push
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add PROBLEMS.md README.md
git diff --staged --quiet || git commit -m "📋 Auto-update problem list"
git push