#!/bin/bash # Generate index navigation page for all problems cd "$(dirname "$0")" cat > index.html << 'HEADER' LeetCode Hot 100 图解算法

🧮 LeetCode Hot 100 图解算法

交互式可视化 · 逐步演示 · 每一步都看得见

100
题目
25
简单
60
中等
15
困难
HEADER # Read problems from JSON and generate cards python3 -c " import json with open('shared/problems.json') as f: probs = json.load(f) cats = {} for p in probs: c = p['category'] if c not in cats: cats[c] = [] cats[c].append(p) diff_cls = {'简单':'easy','中等':'medium','困难':'hard'} diff_icon = {'简单':'🟢','中等':'🟡','困难':'🔴'} for cat, plist in cats.items(): print(f'
') print(f'

{cat}({len(plist)}题)

') print(f'
') for p in plist: d = p['difficulty'] dcls = diff_cls.get(d,'medium') did = str(p['id']).zfill(3) print(f'') print(f'#{did}') print(f'{d}') print(f'
{p[\"title\"]}
') print(f'
') print(f'
') " >> index.html cat >> index.html << 'FOOTER'
FOOTER echo "✅ index.html generated"