diff --git a/.amazonq/rules/problem-creation.md b/.amazonq/rules/problem-creation.md index 8159741..97e2a21 100644 --- a/.amazonq/rules/problem-creation.md +++ b/.amazonq/rules/problem-creation.md @@ -42,15 +42,224 @@ Required fields for `leetcode_py/cli/resources/leetcode/json/problems/{problem_n - `playground_assertion`: Use single quotes for string literals - Double quotes in JSON + cookiecutter + Jupyter notebook = triple escaping issues -**Reference the complete template example:** - -See `leetcode_py/cli/resources/leetcode/examples/example.json5` for a comprehensive template with: - -- All field definitions and variations -- Comments explaining each field -- Examples for different problem types (basic, tree, linked list, design, trie) -- Proper JSON escaping rules for playground fields -- Multiple solution class patterns +**IMPORTANT: Create actual JSON files, not JSON5** + +The template below uses JSON5 format with comments for documentation purposes only. When creating the actual `.json` file, you must: + +1. **Remove all comments** (lines starting with `//`) +2. **Use proper JSON syntax** with quoted property names +3. **Save as `.json` file** (not `.json5`) + +**Template with comments (JSON5 format for reference only):** + +````json5 +{ + // ============================================================================ + // COMPREHENSIVE LEETCODE TEMPLATE EXAMPLE + // ============================================================================ + // This example demonstrates ALL template patterns using valid_anagram as base + // with comprehensive comments showing variations for different problem types. + // + // REFERENCE PROBLEMS (see .templates/leetcode/json/ for complete examples): + // 1. valid_anagram - Basic: string parameters, boolean return + // 2. invert_binary_tree - Tree: TreeNode imports/parameters + // 3. merge_two_sorted_lists - LinkedList: ListNode imports/parameters + // 4. lru_cache - Design: custom class, multiple methods, operations + // 5. implement_trie_prefix_tree - Trie: DictTree inheritance + // ============================================================================ + + // === PROBLEM IDENTIFICATION === + problem_name: "valid_anagram", // snake_case: used for directory/file names + solution_class_name: "Solution", // "Solution" for basic problems + // "LRUCache" for design problems + // "Trie(DictTree[str])" for inheritance + problem_number: "242", // LeetCode problem number as string + problem_title: "Valid Anagram", // Exact title from LeetCode + difficulty: "Easy", // Easy, Medium, Hard + topics: "Hash Table, String, Sorting", // Comma-separated topics from LeetCode + _tags: { list: ["grind-75"] }, // Optional: common problem set tags + // Use _tags wrapper for cookiecutter lists + + // === README CONTENT === + // IMPORTANT: Preserve rich HTML content from LeetCode including: + // - Code snippets with backticks: `code` + // - Bold text: **bold** or bold + // - Italic text: *italic* or italic + // - Images: ![Example](https://assets.leetcode.com/uploads/...) + // - HTML formatting:

,
,