This document provides instructions for AI assistants to automatically generate blog posts from LeetCode solution notes.
When a user provides LeetCode content, follow these steps:
Run the scripts/new-post.js script to create the file and update posts.json.
- Title: "LeetCode [Number]: [Problem Name]"
- Tags:
leetcode, python, dsa, [Topic], interview - Subtitle: A 1-sentence summary of the key insight.
node scripts/new-post.js "LeetCode [Number]: [Name]" --tags=leetcode,python,dsa,... --subtitle="..."Follow the template used in leetcode-152-maximum-product-subarray.mdx:
- Iframe: Include the LeetCode problem link in an iframe.
- Introduction: 1-2 paragraphs with emojis (🚀, 🧩, 🔄).
- The Problem: Quote the problem description and provide an example.
- Approach:
- Heading:
## 🛠️ Approach: [Name] - Explain the logic/intuition.
- Heading:
- Visualization:
- Heading:
## 🔍 Visualizing the Approach (Dry Run) - Use a Markdown table for the steps.
- Heading:
- Code Block: Use syntax highlighting for the language.
- Complexity Analysis:
- Heading:
## ⏱️ Complexity Analysis - Use a Markdown table for Time/Space complexity with a "Rating" column (e.g., 🏆 Optimal).
- Heading:
- Pattern Recognition:
- Heading:
## 🧠 How to Recognize This Pattern - List 2-3 similar problems or scenarios.
- Heading:
- Interview Tips:
- Heading:
## 🎯 Interview Tips - List 2-3 actionable tips for candidates.
- Heading:
"Here is the LeetCode content. Follow the LEETCODE_BLOG_GUIDE.md to create the blog post."