[
  {
    "id": "PY100-E01",
    "difficulty": "easy",
    "slug": "reverse_words",
    "function_name": "reverse_words",
    "signature": "reverse_words(text: str) -> str",
    "description": "Return words in reverse order, separated by one space. Words are maximal non-whitespace spans.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E01-T01",
        "input": [
          "hello world"
        ],
        "expected": "world hello"
      },
      {
        "case_id": "PY100-E01-T02",
        "input": [
          "  one   two three "
        ],
        "expected": "three two one"
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E01-T01",
        "input": [
          "hello world"
        ],
        "expected": "world hello"
      },
      {
        "case_id": "PY100-E01-T02",
        "input": [
          "  one   two three "
        ],
        "expected": "three two one"
      },
      {
        "case_id": "PY100-E01-T03",
        "input": [
          ""
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-E01-T04",
        "input": [
          "single"
        ],
        "expected": "single"
      },
      {
        "case_id": "PY100-E01-T05",
        "input": [
          "a\tb\nc"
        ],
        "expected": "c b a"
      },
      {
        "case_id": "PY100-E01-T06",
        "input": [
          "x  x"
        ],
        "expected": "x x"
      }
    ]
  },
  {
    "id": "PY100-E02",
    "difficulty": "easy",
    "slug": "is_palindrome_alnum",
    "function_name": "is_palindrome_alnum",
    "signature": "is_palindrome_alnum(text: str) -> bool",
    "description": "Ignore non-alphanumeric characters and letter case; determine whether the remaining characters form a palindrome.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E02-T01",
        "input": [
          "A man, a plan, a canal: Panama"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E02-T02",
        "input": [
          "race a car"
        ],
        "expected": false
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E02-T01",
        "input": [
          "A man, a plan, a canal: Panama"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E02-T02",
        "input": [
          "race a car"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-E02-T03",
        "input": [
          ""
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E02-T04",
        "input": [
          ".,!"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E02-T05",
        "input": [
          "0P"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-E02-T06",
        "input": [
          "No lemon, no melon"
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-E03",
    "difficulty": "easy",
    "slug": "rotate_right",
    "function_name": "rotate_right",
    "signature": "rotate_right(nums: list[int], k: int) -> list[int]",
    "description": "Return a new list obtained by rotating nums right by k positions; k is nonnegative. Empty input stays empty.",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E03-T01",
        "input": [
          [
            1,
            2,
            3,
            4,
            5
          ],
          2
        ],
        "expected": [
          4,
          5,
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-E03-T02",
        "input": [
          [
            1,
            2
          ],
          5
        ],
        "expected": [
          2,
          1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E03-T01",
        "input": [
          [
            1,
            2,
            3,
            4,
            5
          ],
          2
        ],
        "expected": [
          4,
          5,
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-E03-T02",
        "input": [
          [
            1,
            2
          ],
          5
        ],
        "expected": [
          2,
          1
        ]
      },
      {
        "case_id": "PY100-E03-T03",
        "input": [
          [],
          7
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E03-T04",
        "input": [
          [
            4
          ],
          100
        ],
        "expected": [
          4
        ]
      },
      {
        "case_id": "PY100-E03-T05",
        "input": [
          [
            1,
            1,
            2
          ],
          0
        ],
        "expected": [
          1,
          1,
          2
        ]
      },
      {
        "case_id": "PY100-E03-T06",
        "input": [
          [
            1,
            2,
            3
          ],
          3
        ],
        "expected": [
          1,
          2,
          3
        ]
      }
    ]
  },
  {
    "id": "PY100-E04",
    "difficulty": "easy",
    "slug": "unique_in_order",
    "function_name": "unique_in_order",
    "signature": "unique_in_order(nums: list[int]) -> list[int]",
    "description": "Remove duplicate integers, preserving the first occurrence order.",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E04-T01",
        "input": [
          [
            1,
            2,
            1,
            3,
            2
          ]
        ],
        "expected": [
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-E04-T02",
        "input": [
          []
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E04-T01",
        "input": [
          [
            1,
            2,
            1,
            3,
            2
          ]
        ],
        "expected": [
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-E04-T02",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E04-T03",
        "input": [
          [
            4,
            4,
            4
          ]
        ],
        "expected": [
          4
        ]
      },
      {
        "case_id": "PY100-E04-T04",
        "input": [
          [
            3,
            2,
            1
          ]
        ],
        "expected": [
          3,
          2,
          1
        ]
      },
      {
        "case_id": "PY100-E04-T05",
        "input": [
          [
            0,
            -1,
            0,
            -1
          ]
        ],
        "expected": [
          0,
          -1
        ]
      },
      {
        "case_id": "PY100-E04-T06",
        "input": [
          [
            1,
            2,
            3,
            1,
            4
          ]
        ],
        "expected": [
          1,
          2,
          3,
          4
        ]
      }
    ]
  },
  {
    "id": "PY100-E05",
    "difficulty": "easy",
    "slug": "word_counts",
    "function_name": "word_counts",
    "signature": "word_counts(text: str) -> dict[str,int]",
    "description": "Count lowercase words; a word is a contiguous run of ASCII letters A-Z/a-z. Ignore punctuation, digits and case.",
    "notes": "",
    "tags": [
      "strings",
      "hashmap"
    ],
    "examples": [
      {
        "case_id": "PY100-E05-T01",
        "input": [
          "Hello, hello! World 123"
        ],
        "expected": {
          "hello": 2,
          "world": 1
        }
      },
      {
        "case_id": "PY100-E05-T02",
        "input": [
          ""
        ],
        "expected": {}
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E05-T01",
        "input": [
          "Hello, hello! World 123"
        ],
        "expected": {
          "hello": 2,
          "world": 1
        }
      },
      {
        "case_id": "PY100-E05-T02",
        "input": [
          ""
        ],
        "expected": {}
      },
      {
        "case_id": "PY100-E05-T03",
        "input": [
          "One1Two"
        ],
        "expected": {
          "one": 1,
          "two": 1
        }
      },
      {
        "case_id": "PY100-E05-T04",
        "input": [
          "A a a B"
        ],
        "expected": {
          "a": 3,
          "b": 1
        }
      },
      {
        "case_id": "PY100-E05-T05",
        "input": [
          "hello_world"
        ],
        "expected": {
          "hello": 1,
          "world": 1
        }
      },
      {
        "case_id": "PY100-E05-T06",
        "input": [
          "X-Y x"
        ],
        "expected": {
          "x": 2,
          "y": 1
        }
      }
    ]
  },
  {
    "id": "PY100-E06",
    "difficulty": "easy",
    "slug": "second_largest_distinct",
    "function_name": "second_largest_distinct",
    "signature": "second_largest_distinct(nums: list[int]) -> int | None",
    "description": "Return the second-largest distinct integer, or null if fewer than two distinct values exist.",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E06-T01",
        "input": [
          [
            4,
            1,
            4,
            2
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E06-T02",
        "input": [
          [
            1,
            1,
            1
          ]
        ],
        "expected": null
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E06-T01",
        "input": [
          [
            4,
            1,
            4,
            2
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E06-T02",
        "input": [
          [
            1,
            1,
            1
          ]
        ],
        "expected": null
      },
      {
        "case_id": "PY100-E06-T03",
        "input": [
          []
        ],
        "expected": null
      },
      {
        "case_id": "PY100-E06-T04",
        "input": [
          [
            -5,
            -2,
            -3
          ]
        ],
        "expected": -3
      },
      {
        "case_id": "PY100-E06-T05",
        "input": [
          [
            1,
            2
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E06-T06",
        "input": [
          [
            9,
            8,
            7,
            9
          ]
        ],
        "expected": 8
      }
    ]
  },
  {
    "id": "PY100-E07",
    "difficulty": "easy",
    "slug": "max_consecutive_ones",
    "function_name": "max_consecutive_ones",
    "signature": "max_consecutive_ones(bits: list[int]) -> int",
    "description": "Return the length of the longest consecutive run of 1s. The list contains only 0s and 1s.",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E07-T01",
        "input": [
          [
            1,
            1,
            0,
            1,
            1,
            1
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-E07-T02",
        "input": [
          []
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E07-T01",
        "input": [
          [
            1,
            1,
            0,
            1,
            1,
            1
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-E07-T02",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E07-T03",
        "input": [
          [
            0,
            0
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E07-T04",
        "input": [
          [
            1,
            1,
            1
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-E07-T05",
        "input": [
          [
            1,
            0,
            1
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E07-T06",
        "input": [
          [
            0,
            1,
            1,
            0,
            1
          ]
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-E08",
    "difficulty": "easy",
    "slug": "balanced_brackets",
    "function_name": "balanced_brackets",
    "signature": "balanced_brackets(text: str) -> bool",
    "description": "Check proper nesting of (), [], {}. Ignore all other characters.",
    "notes": "",
    "tags": [
      "stack"
    ],
    "examples": [
      {
        "case_id": "PY100-E08-T01",
        "input": [
          "([]){}"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E08-T02",
        "input": [
          "([)]"
        ],
        "expected": false
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E08-T01",
        "input": [
          "([]){}"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E08-T02",
        "input": [
          "([)]"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-E08-T03",
        "input": [
          ""
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E08-T04",
        "input": [
          "a(b[c]{d})"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E08-T05",
        "input": [
          "((("
        ],
        "expected": false
      },
      {
        "case_id": "PY100-E08-T06",
        "input": [
          "}"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-E08-T07",
        "input": [
          "[]{}()"
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-E09",
    "difficulty": "easy",
    "slug": "merge_sorted_lists",
    "function_name": "merge_sorted_lists",
    "signature": "merge_sorted_lists(a: list[int], b: list[int]) -> list[int]",
    "description": "Merge two nondecreasing integer lists into one nondecreasing list, retaining duplicates.",
    "notes": "",
    "tags": [
      "sorting"
    ],
    "examples": [
      {
        "case_id": "PY100-E09-T01",
        "input": [
          [
            1,
            3,
            5
          ],
          [
            2,
            4,
            6
          ]
        ],
        "expected": [
          1,
          2,
          3,
          4,
          5,
          6
        ]
      },
      {
        "case_id": "PY100-E09-T02",
        "input": [
          [],
          [
            1
          ]
        ],
        "expected": [
          1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E09-T01",
        "input": [
          [
            1,
            3,
            5
          ],
          [
            2,
            4,
            6
          ]
        ],
        "expected": [
          1,
          2,
          3,
          4,
          5,
          6
        ]
      },
      {
        "case_id": "PY100-E09-T02",
        "input": [
          [],
          [
            1
          ]
        ],
        "expected": [
          1
        ]
      },
      {
        "case_id": "PY100-E09-T03",
        "input": [
          [
            1,
            1
          ],
          [
            1,
            2
          ]
        ],
        "expected": [
          1,
          1,
          1,
          2
        ]
      },
      {
        "case_id": "PY100-E09-T04",
        "input": [
          [],
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E09-T05",
        "input": [
          [
            -3,
            0
          ],
          [
            0,
            5
          ]
        ],
        "expected": [
          -3,
          0,
          0,
          5
        ]
      },
      {
        "case_id": "PY100-E09-T06",
        "input": [
          [
            9
          ],
          [
            1,
            2
          ]
        ],
        "expected": [
          1,
          2,
          9
        ]
      }
    ]
  },
  {
    "id": "PY100-E10",
    "difficulty": "easy",
    "slug": "sorted_intersection",
    "function_name": "sorted_intersection",
    "signature": "sorted_intersection(a: list[int], b: list[int]) -> list[int]",
    "description": "Return distinct integers present in both inputs, sorted ascending.",
    "notes": "",
    "tags": [
      "sets"
    ],
    "examples": [
      {
        "case_id": "PY100-E10-T01",
        "input": [
          [
            1,
            2,
            2,
            3
          ],
          [
            2,
            2,
            4
          ]
        ],
        "expected": [
          2
        ]
      },
      {
        "case_id": "PY100-E10-T02",
        "input": [
          [],
          [
            1
          ]
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E10-T01",
        "input": [
          [
            1,
            2,
            2,
            3
          ],
          [
            2,
            2,
            4
          ]
        ],
        "expected": [
          2
        ]
      },
      {
        "case_id": "PY100-E10-T02",
        "input": [
          [],
          [
            1
          ]
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E10-T03",
        "input": [
          [
            3,
            1
          ],
          [
            2,
            4
          ]
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E10-T04",
        "input": [
          [
            -1,
            0
          ],
          [
            -1,
            1
          ]
        ],
        "expected": [
          -1
        ]
      },
      {
        "case_id": "PY100-E10-T05",
        "input": [
          [
            1,
            2
          ],
          [
            1,
            2
          ]
        ],
        "expected": [
          1,
          2
        ]
      },
      {
        "case_id": "PY100-E10-T06",
        "input": [
          [
            5
          ],
          [
            5,
            5
          ]
        ],
        "expected": [
          5
        ]
      }
    ]
  },
  {
    "id": "PY100-E11",
    "difficulty": "easy",
    "slug": "rle_encode",
    "function_name": "rle_encode",
    "signature": "rle_encode(text: str) -> list[list]",
    "description": "Run-length encode adjacent equal characters as [character,count] pairs in original order.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E11-T01",
        "input": [
          "aaabbc"
        ],
        "expected": [
          [
            "a",
            3
          ],
          [
            "b",
            2
          ],
          [
            "c",
            1
          ]
        ]
      },
      {
        "case_id": "PY100-E11-T02",
        "input": [
          ""
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E11-T01",
        "input": [
          "aaabbc"
        ],
        "expected": [
          [
            "a",
            3
          ],
          [
            "b",
            2
          ],
          [
            "c",
            1
          ]
        ]
      },
      {
        "case_id": "PY100-E11-T02",
        "input": [
          ""
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E11-T03",
        "input": [
          "a"
        ],
        "expected": [
          [
            "a",
            1
          ]
        ]
      },
      {
        "case_id": "PY100-E11-T04",
        "input": [
          "aAa"
        ],
        "expected": [
          [
            "a",
            1
          ],
          [
            "A",
            1
          ],
          [
            "a",
            1
          ]
        ]
      },
      {
        "case_id": "PY100-E11-T05",
        "input": [
          "11122"
        ],
        "expected": [
          [
            "1",
            3
          ],
          [
            "2",
            2
          ]
        ]
      },
      {
        "case_id": "PY100-E11-T06",
        "input": [
          "ababa"
        ],
        "expected": [
          [
            "a",
            1
          ],
          [
            "b",
            1
          ],
          [
            "a",
            1
          ],
          [
            "b",
            1
          ],
          [
            "a",
            1
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-E12",
    "difficulty": "easy",
    "slug": "caesar_lower",
    "function_name": "caesar_lower",
    "signature": "caesar_lower(text: str, shift: int) -> str",
    "description": "Shift lowercase ASCII letters by shift modulo 26, preserving all other characters. shift can be negative.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E12-T01",
        "input": [
          "abc xyz",
          2
        ],
        "expected": "cde zab"
      },
      {
        "case_id": "PY100-E12-T02",
        "input": [
          "Zoo!",
          1
        ],
        "expected": "Zpp!"
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E12-T01",
        "input": [
          "abc xyz",
          2
        ],
        "expected": "cde zab"
      },
      {
        "case_id": "PY100-E12-T02",
        "input": [
          "Zoo!",
          1
        ],
        "expected": "Zpp!"
      },
      {
        "case_id": "PY100-E12-T03",
        "input": [
          "a",
          -1
        ],
        "expected": "z"
      },
      {
        "case_id": "PY100-E12-T04",
        "input": [
          "",
          99
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-E12-T05",
        "input": [
          "hello",
          26
        ],
        "expected": "hello"
      },
      {
        "case_id": "PY100-E12-T06",
        "input": [
          "xyz",
          5
        ],
        "expected": "cde"
      }
    ]
  },
  {
    "id": "PY100-E13",
    "difficulty": "easy",
    "slug": "digital_root",
    "function_name": "digital_root",
    "signature": "digital_root(n: int) -> int",
    "description": "Return the repeated digit sum of nonnegative n until one digit remains.",
    "notes": "",
    "tags": [
      "math"
    ],
    "examples": [
      {
        "case_id": "PY100-E13-T01",
        "input": [
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E13-T02",
        "input": [
          9
        ],
        "expected": 9
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E13-T01",
        "input": [
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E13-T02",
        "input": [
          9
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-E13-T03",
        "input": [
          38
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E13-T04",
        "input": [
          9999
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-E13-T05",
        "input": [
          10
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E13-T06",
        "input": [
          123456789
        ],
        "expected": 9
      }
    ]
  },
  {
    "id": "PY100-E14",
    "difficulty": "easy",
    "slug": "count_vowels",
    "function_name": "count_vowels",
    "signature": "count_vowels(text: str) -> int",
    "description": "Count occurrences of ASCII vowels a,e,i,o,u, case-insensitively.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E14-T01",
        "input": [
          "Hello World"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-E14-T02",
        "input": [
          "AEIOU"
        ],
        "expected": 5
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E14-T01",
        "input": [
          "Hello World"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-E14-T02",
        "input": [
          "AEIOU"
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-E14-T03",
        "input": [
          "rhythm"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E14-T04",
        "input": [
          ""
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E14-T05",
        "input": [
          "aA!1"
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E14-T06",
        "input": [
          "queue"
        ],
        "expected": 4
      }
    ]
  },
  {
    "id": "PY100-E15",
    "difficulty": "easy",
    "slug": "longest_common_prefix",
    "function_name": "longest_common_prefix",
    "signature": "longest_common_prefix(words: list[str]) -> str",
    "description": "Return the longest prefix shared by every string; return empty string for empty input.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E15-T01",
        "input": [
          [
            "flower",
            "flow",
            "flight"
          ]
        ],
        "expected": "fl"
      },
      {
        "case_id": "PY100-E15-T02",
        "input": [
          [
            "dog",
            "racecar",
            "car"
          ]
        ],
        "expected": ""
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E15-T01",
        "input": [
          [
            "flower",
            "flow",
            "flight"
          ]
        ],
        "expected": "fl"
      },
      {
        "case_id": "PY100-E15-T02",
        "input": [
          [
            "dog",
            "racecar",
            "car"
          ]
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-E15-T03",
        "input": [
          []
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-E15-T04",
        "input": [
          [
            "alone"
          ]
        ],
        "expected": "alone"
      },
      {
        "case_id": "PY100-E15-T05",
        "input": [
          [
            "a",
            "a",
            "a"
          ]
        ],
        "expected": "a"
      },
      {
        "case_id": "PY100-E15-T06",
        "input": [
          [
            "",
            "abc"
          ]
        ],
        "expected": ""
      }
    ]
  },
  {
    "id": "PY100-E16",
    "difficulty": "easy",
    "slug": "is_anagram",
    "function_name": "is_anagram",
    "signature": "is_anagram(a: str, b: str) -> bool",
    "description": "Return true iff strings have identical character multisets. Case and whitespace matter.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E16-T01",
        "input": [
          "listen",
          "silent"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E16-T02",
        "input": [
          "rat",
          "car"
        ],
        "expected": false
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E16-T01",
        "input": [
          "listen",
          "silent"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E16-T02",
        "input": [
          "rat",
          "car"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-E16-T03",
        "input": [
          "",
          ""
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E16-T04",
        "input": [
          "aab",
          "aba"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-E16-T05",
        "input": [
          "A",
          "a"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-E16-T06",
        "input": [
          "a b",
          "ab "
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-E17",
    "difficulty": "easy",
    "slug": "fizzbuzz_slice",
    "function_name": "fizzbuzz_slice",
    "signature": "fizzbuzz_slice(start: int, end: int) -> list[str]",
    "description": "For each integer n in inclusive [start,end], output FizzBuzz if divisible by 15, Fizz if divisible by 3, Buzz if divisible by 5, otherwise decimal n. If start>end return [].",
    "notes": "",
    "tags": [
      "math"
    ],
    "examples": [
      {
        "case_id": "PY100-E17-T01",
        "input": [
          1,
          5
        ],
        "expected": [
          "1",
          "2",
          "Fizz",
          "4",
          "Buzz"
        ]
      },
      {
        "case_id": "PY100-E17-T02",
        "input": [
          14,
          16
        ],
        "expected": [
          "14",
          "FizzBuzz",
          "16"
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E17-T01",
        "input": [
          1,
          5
        ],
        "expected": [
          "1",
          "2",
          "Fizz",
          "4",
          "Buzz"
        ]
      },
      {
        "case_id": "PY100-E17-T02",
        "input": [
          14,
          16
        ],
        "expected": [
          "14",
          "FizzBuzz",
          "16"
        ]
      },
      {
        "case_id": "PY100-E17-T03",
        "input": [
          0,
          0
        ],
        "expected": [
          "FizzBuzz"
        ]
      },
      {
        "case_id": "PY100-E17-T04",
        "input": [
          5,
          3
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E17-T05",
        "input": [
          -3,
          3
        ],
        "expected": [
          "Fizz",
          "-2",
          "-1",
          "FizzBuzz",
          "1",
          "2",
          "Fizz"
        ]
      },
      {
        "case_id": "PY100-E17-T06",
        "input": [
          30,
          31
        ],
        "expected": [
          "FizzBuzz",
          "31"
        ]
      }
    ]
  },
  {
    "id": "PY100-E18",
    "difficulty": "easy",
    "slug": "matrix_diagonal_sum",
    "function_name": "matrix_diagonal_sum",
    "signature": "matrix_diagonal_sum(matrix: list[list[int]]) -> int",
    "description": "For a square matrix, return the sum of both diagonals; count their shared center once.",
    "notes": "",
    "tags": [
      "matrix"
    ],
    "examples": [
      {
        "case_id": "PY100-E18-T01",
        "input": [
          [
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-E18-T02",
        "input": [
          [
            [
              5
            ]
          ]
        ],
        "expected": 5
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E18-T01",
        "input": [
          [
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-E18-T02",
        "input": [
          [
            [
              5
            ]
          ]
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-E18-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E18-T04",
        "input": [
          [
            [
              1,
              2,
              3
            ],
            [
              4,
              5,
              6
            ],
            [
              7,
              8,
              9
            ]
          ]
        ],
        "expected": 25
      },
      {
        "case_id": "PY100-E18-T05",
        "input": [
          [
            [
              0,
              0
            ],
            [
              0,
              0
            ]
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E18-T06",
        "input": [
          [
            [
              -1,
              2
            ],
            [
              3,
              -4
            ]
          ]
        ],
        "expected": 0
      }
    ]
  },
  {
    "id": "PY100-E19",
    "difficulty": "easy",
    "slug": "transpose_matrix",
    "function_name": "transpose_matrix",
    "signature": "transpose_matrix(matrix: list[list[int]]) -> list[list[int]]",
    "description": "Transpose a rectangular matrix. Empty matrix returns []; nonempty rows have equal length.",
    "notes": "",
    "tags": [
      "matrix"
    ],
    "examples": [
      {
        "case_id": "PY100-E19-T01",
        "input": [
          [
            [
              1,
              2,
              3
            ],
            [
              4,
              5,
              6
            ]
          ]
        ],
        "expected": [
          [
            1,
            4
          ],
          [
            2,
            5
          ],
          [
            3,
            6
          ]
        ]
      },
      {
        "case_id": "PY100-E19-T02",
        "input": [
          []
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E19-T01",
        "input": [
          [
            [
              1,
              2,
              3
            ],
            [
              4,
              5,
              6
            ]
          ]
        ],
        "expected": [
          [
            1,
            4
          ],
          [
            2,
            5
          ],
          [
            3,
            6
          ]
        ]
      },
      {
        "case_id": "PY100-E19-T02",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E19-T03",
        "input": [
          [
            [
              1
            ]
          ]
        ],
        "expected": [
          [
            1
          ]
        ]
      },
      {
        "case_id": "PY100-E19-T04",
        "input": [
          [
            [
              1
            ],
            [
              2
            ],
            [
              3
            ]
          ]
        ],
        "expected": [
          [
            1,
            2,
            3
          ]
        ]
      },
      {
        "case_id": "PY100-E19-T05",
        "input": [
          [
            [],
            []
          ]
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E19-T06",
        "input": [
          [
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": [
          [
            1,
            3
          ],
          [
            2,
            4
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-E20",
    "difficulty": "easy",
    "slug": "flatten_once",
    "function_name": "flatten_once",
    "signature": "flatten_once(groups: list[list[int]]) -> list[int]",
    "description": "Flatten exactly one level of nested integer lists, preserving order.",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E20-T01",
        "input": [
          [
            [
              1,
              2
            ],
            [],
            [
              3
            ]
          ]
        ],
        "expected": [
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-E20-T02",
        "input": [
          []
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E20-T01",
        "input": [
          [
            [
              1,
              2
            ],
            [],
            [
              3
            ]
          ]
        ],
        "expected": [
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-E20-T02",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E20-T03",
        "input": [
          [
            [],
            []
          ]
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E20-T04",
        "input": [
          [
            [
              1
            ],
            [
              2
            ],
            [
              3
            ]
          ]
        ],
        "expected": [
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-E20-T05",
        "input": [
          [
            [
              -1,
              0
            ],
            [
              0
            ]
          ]
        ],
        "expected": [
          -1,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-E20-T06",
        "input": [
          [
            [
              1,
              1
            ],
            [
              1
            ]
          ]
        ],
        "expected": [
          1,
          1,
          1
        ]
      }
    ]
  },
  {
    "id": "PY100-E21",
    "difficulty": "easy",
    "slug": "cancel_adjacent_pairs",
    "function_name": "cancel_adjacent_pairs",
    "signature": "cancel_adjacent_pairs(text: str) -> str",
    "description": "Repeatedly remove adjacent equal characters until no such pair remains; case-sensitive.",
    "notes": "",
    "tags": [
      "stack"
    ],
    "examples": [
      {
        "case_id": "PY100-E21-T01",
        "input": [
          "abbaca"
        ],
        "expected": "ca"
      },
      {
        "case_id": "PY100-E21-T02",
        "input": [
          "azxxzy"
        ],
        "expected": "ay"
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E21-T01",
        "input": [
          "abbaca"
        ],
        "expected": "ca"
      },
      {
        "case_id": "PY100-E21-T02",
        "input": [
          "azxxzy"
        ],
        "expected": "ay"
      },
      {
        "case_id": "PY100-E21-T03",
        "input": [
          ""
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-E21-T04",
        "input": [
          "aaaa"
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-E21-T05",
        "input": [
          "abBA"
        ],
        "expected": "abBA"
      },
      {
        "case_id": "PY100-E21-T06",
        "input": [
          "aabccb"
        ],
        "expected": ""
      }
    ]
  },
  {
    "id": "PY100-E22",
    "difficulty": "easy",
    "slug": "majority_element",
    "function_name": "majority_element",
    "signature": "majority_element(nums: list[int]) -> int | None",
    "description": "Return the value appearing strictly more than n/2 times, or null if none exists.",
    "notes": "",
    "tags": [
      "hashmap"
    ],
    "examples": [
      {
        "case_id": "PY100-E22-T01",
        "input": [
          [
            2,
            2,
            1,
            2
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E22-T02",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": null
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E22-T01",
        "input": [
          [
            2,
            2,
            1,
            2
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E22-T02",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": null
      },
      {
        "case_id": "PY100-E22-T03",
        "input": [
          []
        ],
        "expected": null
      },
      {
        "case_id": "PY100-E22-T04",
        "input": [
          [
            1
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E22-T05",
        "input": [
          [
            -1,
            -1,
            2,
            2
          ]
        ],
        "expected": null
      },
      {
        "case_id": "PY100-E22-T06",
        "input": [
          [
            -2,
            -2,
            -2,
            1,
            1
          ]
        ],
        "expected": -2
      }
    ]
  },
  {
    "id": "PY100-E23",
    "difficulty": "easy",
    "slug": "missing_zero_to_n",
    "function_name": "missing_zero_to_n",
    "signature": "missing_zero_to_n(nums: list[int]) -> int",
    "description": "The length-n array contains each value from 0 through n except one, without duplicates. Return the missing value.",
    "notes": "",
    "tags": [
      "math",
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E23-T01",
        "input": [
          [
            3,
            0,
            1
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E23-T02",
        "input": [
          [
            0,
            1
          ]
        ],
        "expected": 2
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E23-T01",
        "input": [
          [
            3,
            0,
            1
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E23-T02",
        "input": [
          [
            0,
            1
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E23-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E23-T04",
        "input": [
          [
            1
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E23-T05",
        "input": [
          [
            4,
            2,
            1,
            0
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-E23-T06",
        "input": [
          [
            5,
            4,
            3,
            2,
            1
          ]
        ],
        "expected": 0
      }
    ]
  },
  {
    "id": "PY100-E24",
    "difficulty": "easy",
    "slug": "two_sum_earliest",
    "function_name": "two_sum_earliest",
    "signature": "two_sum_earliest(nums: list[int], target: int) -> list[int]",
    "description": "Return lexicographically smallest pair of indices [i,j] with i<j and nums[i]+nums[j]=target; or [] if none.",
    "notes": "",
    "tags": [
      "arrays",
      "hashmap"
    ],
    "examples": [
      {
        "case_id": "PY100-E24-T01",
        "input": [
          [
            2,
            7,
            11,
            15
          ],
          9
        ],
        "expected": [
          0,
          1
        ]
      },
      {
        "case_id": "PY100-E24-T02",
        "input": [
          [
            3,
            3
          ],
          6
        ],
        "expected": [
          0,
          1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E24-T01",
        "input": [
          [
            2,
            7,
            11,
            15
          ],
          9
        ],
        "expected": [
          0,
          1
        ]
      },
      {
        "case_id": "PY100-E24-T02",
        "input": [
          [
            3,
            3
          ],
          6
        ],
        "expected": [
          0,
          1
        ]
      },
      {
        "case_id": "PY100-E24-T03",
        "input": [
          [
            1,
            2,
            3,
            4
          ],
          5
        ],
        "expected": [
          0,
          3
        ]
      },
      {
        "case_id": "PY100-E24-T04",
        "input": [
          [
            1
          ],
          2
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E24-T05",
        "input": [
          [],
          1
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E24-T06",
        "input": [
          [
            0,
            0,
            0
          ],
          0
        ],
        "expected": [
          0,
          1
        ]
      }
    ]
  },
  {
    "id": "PY100-E25",
    "difficulty": "easy",
    "slug": "first_binary_index",
    "function_name": "first_binary_index",
    "signature": "first_binary_index(nums: list[int], target: int) -> int",
    "description": "Return the first index of target in sorted nondecreasing nums; -1 when absent.",
    "notes": "",
    "tags": [
      "binary-search"
    ],
    "examples": [
      {
        "case_id": "PY100-E25-T01",
        "input": [
          [
            1,
            2,
            2,
            3
          ],
          2
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E25-T02",
        "input": [
          [],
          1
        ],
        "expected": -1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E25-T01",
        "input": [
          [
            1,
            2,
            2,
            3
          ],
          2
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E25-T02",
        "input": [
          [],
          1
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-E25-T03",
        "input": [
          [
            1,
            2,
            3
          ],
          4
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-E25-T04",
        "input": [
          [
            4,
            4,
            4
          ],
          4
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E25-T05",
        "input": [
          [
            -5,
            -1,
            0
          ],
          -1
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E25-T06",
        "input": [
          [
            1
          ],
          1
        ],
        "expected": 0
      }
    ]
  },
  {
    "id": "PY100-E26",
    "difficulty": "easy",
    "slug": "ascii_title_words",
    "function_name": "ascii_title_words",
    "signature": "ascii_title_words(text: str) -> str",
    "description": "Convert words separated by ASCII spaces to title case: first character uppercase, remaining lowercase; preserve the exact number of spaces. Inputs contain ASCII letters and spaces only.",
    "notes": "",
    "tags": [
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-E26-T01",
        "input": [
          "hello WORLD"
        ],
        "expected": "Hello World"
      },
      {
        "case_id": "PY100-E26-T02",
        "input": [
          "  a  b "
        ],
        "expected": "  A  B "
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E26-T01",
        "input": [
          "hello WORLD"
        ],
        "expected": "Hello World"
      },
      {
        "case_id": "PY100-E26-T02",
        "input": [
          "  a  b "
        ],
        "expected": "  A  B "
      },
      {
        "case_id": "PY100-E26-T03",
        "input": [
          ""
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-E26-T04",
        "input": [
          "PYTHON"
        ],
        "expected": "Python"
      },
      {
        "case_id": "PY100-E26-T05",
        "input": [
          "x"
        ],
        "expected": "X"
      },
      {
        "case_id": "PY100-E26-T06",
        "input": [
          "aBc DEF ghi"
        ],
        "expected": "Abc Def Ghi"
      }
    ]
  },
  {
    "id": "PY100-E27",
    "difficulty": "easy",
    "slug": "inclusive_prefix_sums",
    "function_name": "inclusive_prefix_sums",
    "signature": "inclusive_prefix_sums(nums: list[int]) -> list[int]",
    "description": "Return cumulative prefix sums, including each current element.",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E27-T01",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": [
          1,
          3,
          6
        ]
      },
      {
        "case_id": "PY100-E27-T02",
        "input": [
          []
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E27-T01",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": [
          1,
          3,
          6
        ]
      },
      {
        "case_id": "PY100-E27-T02",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-E27-T03",
        "input": [
          [
            -1,
            4,
            -2
          ]
        ],
        "expected": [
          -1,
          3,
          1
        ]
      },
      {
        "case_id": "PY100-E27-T04",
        "input": [
          [
            0,
            0
          ]
        ],
        "expected": [
          0,
          0
        ]
      },
      {
        "case_id": "PY100-E27-T05",
        "input": [
          [
            10
          ]
        ],
        "expected": [
          10
        ]
      },
      {
        "case_id": "PY100-E27-T06",
        "input": [
          [
            2,
            -2,
            2,
            -2
          ]
        ],
        "expected": [
          2,
          0,
          2,
          0
        ]
      }
    ]
  },
  {
    "id": "PY100-E28",
    "difficulty": "easy",
    "slug": "count_unique_pairs",
    "function_name": "count_unique_pairs",
    "signature": "count_unique_pairs(nums: list[int], target: int) -> int",
    "description": "Count distinct unordered value pairs (a,b) with a<=b, sum target, and enough occurrences when a==b.",
    "notes": "",
    "tags": [
      "hashmap"
    ],
    "examples": [
      {
        "case_id": "PY100-E28-T01",
        "input": [
          [
            1,
            2,
            3,
            2,
            4
          ],
          5
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E28-T02",
        "input": [
          [
            1,
            1
          ],
          2
        ],
        "expected": 1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E28-T01",
        "input": [
          [
            1,
            2,
            3,
            2,
            4
          ],
          5
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E28-T02",
        "input": [
          [
            1,
            1
          ],
          2
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E28-T03",
        "input": [
          [
            1
          ],
          2
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E28-T04",
        "input": [
          [],
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E28-T05",
        "input": [
          [
            -2,
            -1,
            0,
            1,
            2
          ],
          0
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-E28-T06",
        "input": [
          [
            0,
            0,
            0
          ],
          0
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-E29",
    "difficulty": "easy",
    "slug": "group_by_parity",
    "function_name": "group_by_parity",
    "signature": "group_by_parity(nums: list[int]) -> list[list[int]]",
    "description": "Return [even_numbers, odd_numbers], preserving input order within both lists; negative odd numbers are odd.",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-E29-T01",
        "input": [
          [
            1,
            2,
            3,
            4
          ]
        ],
        "expected": [
          [
            2,
            4
          ],
          [
            1,
            3
          ]
        ]
      },
      {
        "case_id": "PY100-E29-T02",
        "input": [
          []
        ],
        "expected": [
          [],
          []
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E29-T01",
        "input": [
          [
            1,
            2,
            3,
            4
          ]
        ],
        "expected": [
          [
            2,
            4
          ],
          [
            1,
            3
          ]
        ]
      },
      {
        "case_id": "PY100-E29-T02",
        "input": [
          []
        ],
        "expected": [
          [],
          []
        ]
      },
      {
        "case_id": "PY100-E29-T03",
        "input": [
          [
            -3,
            -2,
            -1,
            0
          ]
        ],
        "expected": [
          [
            -2,
            0
          ],
          [
            -3,
            -1
          ]
        ]
      },
      {
        "case_id": "PY100-E29-T04",
        "input": [
          [
            2,
            4,
            6
          ]
        ],
        "expected": [
          [
            2,
            4,
            6
          ],
          []
        ]
      },
      {
        "case_id": "PY100-E29-T05",
        "input": [
          [
            1,
            3
          ]
        ],
        "expected": [
          [],
          [
            1,
            3
          ]
        ]
      },
      {
        "case_id": "PY100-E29-T06",
        "input": [
          [
            0
          ]
        ],
        "expected": [
          [
            0
          ],
          []
        ]
      }
    ]
  },
  {
    "id": "PY100-E30",
    "difficulty": "easy",
    "slug": "rect_overlap_area",
    "function_name": "rect_overlap_area",
    "signature": "rect_overlap_area(a: list[int], b: list[int]) -> int",
    "description": "Axis-aligned rectangles [x1,y1,x2,y2] with x1<x2,y1<y2. Return intersection area (0 if disjoint or touching).",
    "notes": "",
    "tags": [
      "geometry"
    ],
    "examples": [
      {
        "case_id": "PY100-E30-T01",
        "input": [
          [
            0,
            0,
            3,
            3
          ],
          [
            1,
            1,
            4,
            4
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-E30-T02",
        "input": [
          [
            0,
            0,
            1,
            1
          ],
          [
            1,
            1,
            2,
            2
          ]
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-E30-T01",
        "input": [
          [
            0,
            0,
            3,
            3
          ],
          [
            1,
            1,
            4,
            4
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-E30-T02",
        "input": [
          [
            0,
            0,
            1,
            1
          ],
          [
            1,
            1,
            2,
            2
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E30-T03",
        "input": [
          [
            0,
            0,
            5,
            5
          ],
          [
            1,
            1,
            2,
            2
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-E30-T04",
        "input": [
          [
            -2,
            -2,
            2,
            2
          ],
          [
            0,
            0,
            4,
            4
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-E30-T05",
        "input": [
          [
            0,
            0,
            1,
            1
          ],
          [
            3,
            3,
            5,
            5
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-E30-T06",
        "input": [
          [
            0,
            0,
            2,
            4
          ],
          [
            1,
            -2,
            3,
            2
          ]
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-M01",
    "difficulty": "medium",
    "slug": "min_positive_subarray",
    "function_name": "min_positive_subarray",
    "signature": "min_positive_subarray(nums: list[int], target: int) -> int",
    "description": "All nums positive; return minimum length of a contiguous subarray with sum >= target, or 0 if impossible.",
    "notes": "",
    "tags": [
      "sliding-window"
    ],
    "examples": [
      {
        "case_id": "PY100-M01-T01",
        "input": [
          [
            2,
            3,
            1,
            2,
            4,
            3
          ],
          7
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M01-T02",
        "input": [
          [
            1,
            1,
            1
          ],
          4
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M01-T01",
        "input": [
          [
            2,
            3,
            1,
            2,
            4,
            3
          ],
          7
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M01-T02",
        "input": [
          [
            1,
            1,
            1
          ],
          4
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M01-T03",
        "input": [
          [],
          1
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M01-T04",
        "input": [
          [
            5
          ],
          5
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M01-T05",
        "input": [
          [
            5
          ],
          6
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M01-T06",
        "input": [
          [
            1,
            2,
            3,
            4
          ],
          6
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-M02",
    "difficulty": "medium",
    "slug": "longest_unique_substring",
    "function_name": "longest_unique_substring",
    "signature": "longest_unique_substring(text: str) -> int",
    "description": "Length of longest substring with no repeated characters; case-sensitive.",
    "notes": "",
    "tags": [
      "sliding-window"
    ],
    "examples": [
      {
        "case_id": "PY100-M02-T01",
        "input": [
          "abcabcbb"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M02-T02",
        "input": [
          "bbbbb"
        ],
        "expected": 1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M02-T01",
        "input": [
          "abcabcbb"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M02-T02",
        "input": [
          "bbbbb"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M02-T03",
        "input": [
          "pwwkew"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M02-T04",
        "input": [
          ""
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M02-T05",
        "input": [
          "abba"
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M02-T06",
        "input": [
          "aA"
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-M03",
    "difficulty": "medium",
    "slug": "longest_k_distinct",
    "function_name": "longest_k_distinct",
    "signature": "longest_k_distinct(nums: list[int], k: int) -> int",
    "description": "Return longest contiguous segment containing at most k distinct integers; k>=0.",
    "notes": "",
    "tags": [
      "sliding-window"
    ],
    "examples": [
      {
        "case_id": "PY100-M03-T01",
        "input": [
          [
            1,
            2,
            1,
            2,
            3
          ],
          2
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M03-T02",
        "input": [
          [
            1,
            1,
            1
          ],
          1
        ],
        "expected": 3
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M03-T01",
        "input": [
          [
            1,
            2,
            1,
            2,
            3
          ],
          2
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M03-T02",
        "input": [
          [
            1,
            1,
            1
          ],
          1
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M03-T03",
        "input": [
          [
            1,
            2
          ],
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M03-T04",
        "input": [
          [],
          3
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M03-T05",
        "input": [
          [
            1,
            2,
            3
          ],
          3
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M03-T06",
        "input": [
          [
            1,
            2,
            2,
            3,
            3,
            3
          ],
          2
        ],
        "expected": 5
      }
    ]
  },
  {
    "id": "PY100-M04",
    "difficulty": "medium",
    "slug": "subarray_sum_count",
    "function_name": "subarray_sum_count",
    "signature": "subarray_sum_count(nums: list[int], k: int) -> int",
    "description": "Count nonempty contiguous subarrays whose sum is k. Values may be negative.",
    "notes": "",
    "tags": [
      "prefix-sum"
    ],
    "examples": [
      {
        "case_id": "PY100-M04-T01",
        "input": [
          [
            1,
            1,
            1
          ],
          2
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M04-T02",
        "input": [
          [
            1,
            -1,
            0
          ],
          0
        ],
        "expected": 3
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M04-T01",
        "input": [
          [
            1,
            1,
            1
          ],
          2
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M04-T02",
        "input": [
          [
            1,
            -1,
            0
          ],
          0
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M04-T03",
        "input": [
          [],
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M04-T04",
        "input": [
          [
            0,
            0,
            0
          ],
          0
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-M04-T05",
        "input": [
          [
            1,
            2,
            3
          ],
          3
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M04-T06",
        "input": [
          [
            -1,
            -1,
            1
          ],
          -1
        ],
        "expected": 3
      }
    ]
  },
  {
    "id": "PY100-M05",
    "difficulty": "medium",
    "slug": "product_except_self",
    "function_name": "product_except_self",
    "signature": "product_except_self(nums: list[int]) -> list[int]",
    "description": "Return products of all elements except at each index; no division required; empty input yields [].",
    "notes": "",
    "tags": [
      "arrays"
    ],
    "examples": [
      {
        "case_id": "PY100-M05-T01",
        "input": [
          [
            1,
            2,
            3,
            4
          ]
        ],
        "expected": [
          24,
          12,
          8,
          6
        ]
      },
      {
        "case_id": "PY100-M05-T02",
        "input": [
          [
            0,
            1,
            2,
            3
          ]
        ],
        "expected": [
          6,
          0,
          0,
          0
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M05-T01",
        "input": [
          [
            1,
            2,
            3,
            4
          ]
        ],
        "expected": [
          24,
          12,
          8,
          6
        ]
      },
      {
        "case_id": "PY100-M05-T02",
        "input": [
          [
            0,
            1,
            2,
            3
          ]
        ],
        "expected": [
          6,
          0,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-M05-T03",
        "input": [
          [
            0,
            0,
            1
          ]
        ],
        "expected": [
          0,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-M05-T04",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M05-T05",
        "input": [
          [
            -1,
            2,
            -3
          ]
        ],
        "expected": [
          -6,
          3,
          -2
        ]
      },
      {
        "case_id": "PY100-M05-T06",
        "input": [
          [
            5
          ]
        ],
        "expected": [
          1
        ]
      }
    ]
  },
  {
    "id": "PY100-M06",
    "difficulty": "medium",
    "slug": "max_circular_subarray",
    "function_name": "max_circular_subarray",
    "signature": "max_circular_subarray(nums: list[int]) -> int",
    "description": "For nonempty nums, return maximum sum of a nonempty contiguous circular subarray; no element may be used twice.",
    "notes": "",
    "tags": [
      "arrays",
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M06-T01",
        "input": [
          [
            1,
            -2,
            3,
            -2
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M06-T02",
        "input": [
          [
            5,
            -3,
            5
          ]
        ],
        "expected": 10
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M06-T01",
        "input": [
          [
            1,
            -2,
            3,
            -2
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M06-T02",
        "input": [
          [
            5,
            -3,
            5
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-M06-T03",
        "input": [
          [
            -3,
            -2,
            -3
          ]
        ],
        "expected": -2
      },
      {
        "case_id": "PY100-M06-T04",
        "input": [
          [
            3
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M06-T05",
        "input": [
          [
            -1,
            4,
            -2,
            5
          ]
        ],
        "expected": 8
      },
      {
        "case_id": "PY100-M06-T06",
        "input": [
          [
            -5,
            5
          ]
        ],
        "expected": 5
      }
    ]
  },
  {
    "id": "PY100-M07",
    "difficulty": "medium",
    "slug": "spiral_matrix",
    "function_name": "spiral_matrix",
    "signature": "spiral_matrix(matrix: list[list[int]]) -> list[int]",
    "description": "Return rectangular matrix entries in clockwise spiral order starting top-left.",
    "notes": "",
    "tags": [
      "matrix"
    ],
    "examples": [
      {
        "case_id": "PY100-M07-T01",
        "input": [
          [
            [
              1,
              2,
              3
            ],
            [
              4,
              5,
              6
            ],
            [
              7,
              8,
              9
            ]
          ]
        ],
        "expected": [
          1,
          2,
          3,
          6,
          9,
          8,
          7,
          4,
          5
        ]
      },
      {
        "case_id": "PY100-M07-T02",
        "input": [
          [
            [
              1,
              2,
              3
            ]
          ]
        ],
        "expected": [
          1,
          2,
          3
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M07-T01",
        "input": [
          [
            [
              1,
              2,
              3
            ],
            [
              4,
              5,
              6
            ],
            [
              7,
              8,
              9
            ]
          ]
        ],
        "expected": [
          1,
          2,
          3,
          6,
          9,
          8,
          7,
          4,
          5
        ]
      },
      {
        "case_id": "PY100-M07-T02",
        "input": [
          [
            [
              1,
              2,
              3
            ]
          ]
        ],
        "expected": [
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-M07-T03",
        "input": [
          [
            [
              1
            ],
            [
              2
            ]
          ]
        ],
        "expected": [
          1,
          2
        ]
      },
      {
        "case_id": "PY100-M07-T04",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M07-T05",
        "input": [
          [
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": [
          1,
          2,
          4,
          3
        ]
      },
      {
        "case_id": "PY100-M07-T06",
        "input": [
          [
            [
              1
            ]
          ]
        ],
        "expected": [
          1
        ]
      }
    ]
  },
  {
    "id": "PY100-M08",
    "difficulty": "medium",
    "slug": "search_rotated_unique",
    "function_name": "search_rotated_unique",
    "signature": "search_rotated_unique(nums: list[int], target: int) -> int",
    "description": "nums is a rotated strictly increasing array with unique values. Return target index or -1.",
    "notes": "",
    "tags": [
      "binary-search"
    ],
    "examples": [
      {
        "case_id": "PY100-M08-T01",
        "input": [
          [
            4,
            5,
            6,
            7,
            0,
            1,
            2
          ],
          0
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M08-T02",
        "input": [
          [
            4,
            5,
            6,
            7,
            0,
            1,
            2
          ],
          3
        ],
        "expected": -1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M08-T01",
        "input": [
          [
            4,
            5,
            6,
            7,
            0,
            1,
            2
          ],
          0
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M08-T02",
        "input": [
          [
            4,
            5,
            6,
            7,
            0,
            1,
            2
          ],
          3
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-M08-T03",
        "input": [
          [],
          5
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-M08-T04",
        "input": [
          [
            1
          ],
          1
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M08-T05",
        "input": [
          [
            3,
            1
          ],
          1
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M08-T06",
        "input": [
          [
            1,
            2,
            3
          ],
          2
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-M09",
    "difficulty": "medium",
    "slug": "find_first_last",
    "function_name": "find_first_last",
    "signature": "find_first_last(nums: list[int], target: int) -> list[int]",
    "description": "Return [first_index,last_index] of target in sorted array; [-1,-1] if absent.",
    "notes": "",
    "tags": [
      "binary-search"
    ],
    "examples": [
      {
        "case_id": "PY100-M09-T01",
        "input": [
          [
            5,
            7,
            7,
            8,
            8,
            10
          ],
          8
        ],
        "expected": [
          3,
          4
        ]
      },
      {
        "case_id": "PY100-M09-T02",
        "input": [
          [
            5,
            7,
            7,
            8
          ],
          6
        ],
        "expected": [
          -1,
          -1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M09-T01",
        "input": [
          [
            5,
            7,
            7,
            8,
            8,
            10
          ],
          8
        ],
        "expected": [
          3,
          4
        ]
      },
      {
        "case_id": "PY100-M09-T02",
        "input": [
          [
            5,
            7,
            7,
            8
          ],
          6
        ],
        "expected": [
          -1,
          -1
        ]
      },
      {
        "case_id": "PY100-M09-T03",
        "input": [
          [],
          0
        ],
        "expected": [
          -1,
          -1
        ]
      },
      {
        "case_id": "PY100-M09-T04",
        "input": [
          [
            2,
            2,
            2
          ],
          2
        ],
        "expected": [
          0,
          2
        ]
      },
      {
        "case_id": "PY100-M09-T05",
        "input": [
          [
            1,
            2,
            3
          ],
          1
        ],
        "expected": [
          0,
          0
        ]
      },
      {
        "case_id": "PY100-M09-T06",
        "input": [
          [
            1,
            2,
            2,
            3
          ],
          3
        ],
        "expected": [
          3,
          3
        ]
      }
    ]
  },
  {
    "id": "PY100-M10",
    "difficulty": "medium",
    "slug": "merge_intervals",
    "function_name": "merge_intervals",
    "signature": "merge_intervals(intervals: list[list[int]]) -> list[list[int]]",
    "description": "Merge closed intervals [start,end] when overlapping or touching; return sorted merged intervals.",
    "notes": "",
    "tags": [
      "intervals"
    ],
    "examples": [
      {
        "case_id": "PY100-M10-T01",
        "input": [
          [
            [
              1,
              3
            ],
            [
              2,
              6
            ],
            [
              8,
              10
            ],
            [
              15,
              18
            ]
          ]
        ],
        "expected": [
          [
            1,
            6
          ],
          [
            8,
            10
          ],
          [
            15,
            18
          ]
        ]
      },
      {
        "case_id": "PY100-M10-T02",
        "input": [
          [
            [
              1,
              4
            ],
            [
              4,
              5
            ]
          ]
        ],
        "expected": [
          [
            1,
            5
          ]
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M10-T01",
        "input": [
          [
            [
              1,
              3
            ],
            [
              2,
              6
            ],
            [
              8,
              10
            ],
            [
              15,
              18
            ]
          ]
        ],
        "expected": [
          [
            1,
            6
          ],
          [
            8,
            10
          ],
          [
            15,
            18
          ]
        ]
      },
      {
        "case_id": "PY100-M10-T02",
        "input": [
          [
            [
              1,
              4
            ],
            [
              4,
              5
            ]
          ]
        ],
        "expected": [
          [
            1,
            5
          ]
        ]
      },
      {
        "case_id": "PY100-M10-T03",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M10-T04",
        "input": [
          [
            [
              5,
              7
            ],
            [
              1,
              2
            ]
          ]
        ],
        "expected": [
          [
            1,
            2
          ],
          [
            5,
            7
          ]
        ]
      },
      {
        "case_id": "PY100-M10-T05",
        "input": [
          [
            [
              -5,
              -1
            ],
            [
              -2,
              2
            ]
          ]
        ],
        "expected": [
          [
            -5,
            2
          ]
        ]
      },
      {
        "case_id": "PY100-M10-T06",
        "input": [
          [
            [
              1,
              10
            ],
            [
              2,
              3
            ],
            [
              4,
              8
            ]
          ]
        ],
        "expected": [
          [
            1,
            10
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-M11",
    "difficulty": "medium",
    "slug": "insert_interval",
    "function_name": "insert_interval",
    "signature": "insert_interval(intervals: list[list[int]], new_interval: list[int]) -> list[list[int]]",
    "description": "Insert a closed interval into nonoverlapping sorted closed intervals, merging overlap/touch.",
    "notes": "",
    "tags": [
      "intervals"
    ],
    "examples": [
      {
        "case_id": "PY100-M11-T01",
        "input": [
          [
            [
              1,
              3
            ],
            [
              6,
              9
            ]
          ],
          [
            2,
            5
          ]
        ],
        "expected": [
          [
            1,
            5
          ],
          [
            6,
            9
          ]
        ]
      },
      {
        "case_id": "PY100-M11-T02",
        "input": [
          [
            [
              1,
              2
            ],
            [
              3,
              5
            ],
            [
              6,
              7
            ],
            [
              8,
              10
            ],
            [
              12,
              16
            ]
          ],
          [
            4,
            8
          ]
        ],
        "expected": [
          [
            1,
            2
          ],
          [
            3,
            10
          ],
          [
            12,
            16
          ]
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M11-T01",
        "input": [
          [
            [
              1,
              3
            ],
            [
              6,
              9
            ]
          ],
          [
            2,
            5
          ]
        ],
        "expected": [
          [
            1,
            5
          ],
          [
            6,
            9
          ]
        ]
      },
      {
        "case_id": "PY100-M11-T02",
        "input": [
          [
            [
              1,
              2
            ],
            [
              3,
              5
            ],
            [
              6,
              7
            ],
            [
              8,
              10
            ],
            [
              12,
              16
            ]
          ],
          [
            4,
            8
          ]
        ],
        "expected": [
          [
            1,
            2
          ],
          [
            3,
            10
          ],
          [
            12,
            16
          ]
        ]
      },
      {
        "case_id": "PY100-M11-T03",
        "input": [
          [],
          [
            1,
            2
          ]
        ],
        "expected": [
          [
            1,
            2
          ]
        ]
      },
      {
        "case_id": "PY100-M11-T04",
        "input": [
          [
            [
              1,
              5
            ]
          ],
          [
            6,
            8
          ]
        ],
        "expected": [
          [
            1,
            5
          ],
          [
            6,
            8
          ]
        ]
      },
      {
        "case_id": "PY100-M11-T05",
        "input": [
          [
            [
              1,
              5
            ]
          ],
          [
            2,
            3
          ]
        ],
        "expected": [
          [
            1,
            5
          ]
        ]
      },
      {
        "case_id": "PY100-M11-T06",
        "input": [
          [
            [
              -5,
              -1
            ],
            [
              2,
              4
            ]
          ],
          [
            0,
            1
          ]
        ],
        "expected": [
          [
            -5,
            -1
          ],
          [
            0,
            1
          ],
          [
            2,
            4
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-M12",
    "difficulty": "medium",
    "slug": "minimum_meeting_rooms",
    "function_name": "minimum_meeting_rooms",
    "signature": "minimum_meeting_rooms(intervals: list[list[int]]) -> int",
    "description": "Intervals are [start,end) with start<end. Return minimum number of rooms; end at time t can reuse a room starting at t.",
    "notes": "",
    "tags": [
      "intervals",
      "heap"
    ],
    "examples": [
      {
        "case_id": "PY100-M12-T01",
        "input": [
          [
            [
              0,
              30
            ],
            [
              5,
              10
            ],
            [
              15,
              20
            ]
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M12-T02",
        "input": [
          [
            [
              7,
              10
            ],
            [
              2,
              4
            ]
          ]
        ],
        "expected": 1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M12-T01",
        "input": [
          [
            [
              0,
              30
            ],
            [
              5,
              10
            ],
            [
              15,
              20
            ]
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M12-T02",
        "input": [
          [
            [
              7,
              10
            ],
            [
              2,
              4
            ]
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M12-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M12-T04",
        "input": [
          [
            [
              1,
              2
            ],
            [
              2,
              3
            ]
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M12-T05",
        "input": [
          [
            [
              1,
              5
            ],
            [
              2,
              6
            ],
            [
              3,
              7
            ]
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M12-T06",
        "input": [
          [
            [
              0,
              1
            ]
          ]
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-M13",
    "difficulty": "medium",
    "slug": "courses_possible",
    "function_name": "courses_possible",
    "signature": "courses_possible(num_courses: int, prerequisites: list[list[int]]) -> bool",
    "description": "Pairs [course,prerequisite] impose prerequisite ordering. Return whether all courses can be finished.",
    "notes": "",
    "tags": [
      "graphs"
    ],
    "examples": [
      {
        "case_id": "PY100-M13-T01",
        "input": [
          2,
          [
            [
              1,
              0
            ]
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M13-T02",
        "input": [
          2,
          [
            [
              1,
              0
            ],
            [
              0,
              1
            ]
          ]
        ],
        "expected": false
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M13-T01",
        "input": [
          2,
          [
            [
              1,
              0
            ]
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M13-T02",
        "input": [
          2,
          [
            [
              1,
              0
            ],
            [
              0,
              1
            ]
          ]
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M13-T03",
        "input": [
          0,
          []
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M13-T04",
        "input": [
          3,
          [
            [
              1,
              0
            ],
            [
              2,
              1
            ]
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M13-T05",
        "input": [
          3,
          [
            [
              0,
              0
            ]
          ]
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M13-T06",
        "input": [
          4,
          [
            [
              1,
              0
            ],
            [
              3,
              2
            ]
          ]
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-M14",
    "difficulty": "medium",
    "slug": "lexicographic_toposort",
    "function_name": "lexicographic_toposort",
    "signature": "lexicographic_toposort(n: int, edges: list[list[int]]) -> list[int]",
    "description": "Directed edges [u,v] mean u before v; return lexicographically smallest valid topological order of nodes 0..n-1, or [] if a cycle.",
    "notes": "",
    "tags": [
      "graphs",
      "heap"
    ],
    "examples": [
      {
        "case_id": "PY100-M14-T01",
        "input": [
          4,
          [
            [
              0,
              2
            ],
            [
              1,
              2
            ]
          ]
        ],
        "expected": [
          0,
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-M14-T02",
        "input": [
          3,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ]
          ]
        ],
        "expected": [
          0,
          1,
          2
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M14-T01",
        "input": [
          4,
          [
            [
              0,
              2
            ],
            [
              1,
              2
            ]
          ]
        ],
        "expected": [
          0,
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-M14-T02",
        "input": [
          3,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ]
          ]
        ],
        "expected": [
          0,
          1,
          2
        ]
      },
      {
        "case_id": "PY100-M14-T03",
        "input": [
          2,
          [
            [
              0,
              1
            ],
            [
              1,
              0
            ]
          ]
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M14-T04",
        "input": [
          0,
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M14-T05",
        "input": [
          4,
          []
        ],
        "expected": [
          0,
          1,
          2,
          3
        ]
      },
      {
        "case_id": "PY100-M14-T06",
        "input": [
          5,
          [
            [
              2,
              3
            ],
            [
              3,
              4
            ],
            [
              1,
              4
            ]
          ]
        ],
        "expected": [
          0,
          1,
          2,
          3,
          4
        ]
      }
    ]
  },
  {
    "id": "PY100-M15",
    "difficulty": "medium",
    "slug": "island_count",
    "function_name": "island_count",
    "signature": "island_count(grid: list[str]) -> int",
    "description": "Rectangular grid of 0 and 1 characters. Count four-directionally connected components of 1 cells.",
    "notes": "",
    "tags": [
      "graphs",
      "grid"
    ],
    "examples": [
      {
        "case_id": "PY100-M15-T01",
        "input": [
          [
            "110",
            "010",
            "001"
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M15-T02",
        "input": [
          [
            "111",
            "111"
          ]
        ],
        "expected": 1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M15-T01",
        "input": [
          [
            "110",
            "010",
            "001"
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M15-T02",
        "input": [
          [
            "111",
            "111"
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M15-T03",
        "input": [
          [
            "000",
            "000"
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M15-T04",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M15-T05",
        "input": [
          [
            "1"
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M15-T06",
        "input": [
          [
            "10101"
          ]
        ],
        "expected": 3
      }
    ]
  },
  {
    "id": "PY100-M16",
    "difficulty": "medium",
    "slug": "flood_fill",
    "function_name": "flood_fill",
    "signature": "flood_fill(grid: list[list[int]], sr: int, sc: int, new_color: int) -> list[list[int]]",
    "description": "Replace the four-connected component containing (sr,sc) with new_color; grid nonempty and coordinates valid.",
    "notes": "",
    "tags": [
      "grid"
    ],
    "examples": [
      {
        "case_id": "PY100-M16-T01",
        "input": [
          [
            [
              1,
              1,
              1
            ],
            [
              1,
              1,
              0
            ],
            [
              1,
              0,
              1
            ]
          ],
          1,
          1,
          2
        ],
        "expected": [
          [
            2,
            2,
            2
          ],
          [
            2,
            2,
            0
          ],
          [
            2,
            0,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M16-T02",
        "input": [
          [
            [
              0
            ]
          ],
          0,
          0,
          1
        ],
        "expected": [
          [
            1
          ]
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M16-T01",
        "input": [
          [
            [
              1,
              1,
              1
            ],
            [
              1,
              1,
              0
            ],
            [
              1,
              0,
              1
            ]
          ],
          1,
          1,
          2
        ],
        "expected": [
          [
            2,
            2,
            2
          ],
          [
            2,
            2,
            0
          ],
          [
            2,
            0,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M16-T02",
        "input": [
          [
            [
              0
            ]
          ],
          0,
          0,
          1
        ],
        "expected": [
          [
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M16-T03",
        "input": [
          [
            [
              1,
              2
            ],
            [
              2,
              1
            ]
          ],
          0,
          0,
          3
        ],
        "expected": [
          [
            3,
            2
          ],
          [
            2,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M16-T04",
        "input": [
          [
            [
              1,
              1
            ]
          ],
          0,
          1,
          1
        ],
        "expected": [
          [
            1,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M16-T05",
        "input": [
          [
            [
              2,
              2
            ],
            [
              2,
              3
            ]
          ],
          1,
          1,
          8
        ],
        "expected": [
          [
            2,
            2
          ],
          [
            2,
            8
          ]
        ]
      },
      {
        "case_id": "PY100-M16-T06",
        "input": [
          [
            [
              0,
              0
            ],
            [
              0,
              0
            ]
          ],
          0,
          0,
          5
        ],
        "expected": [
          [
            5,
            5
          ],
          [
            5,
            5
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-M17",
    "difficulty": "medium",
    "slug": "shortest_binary_grid",
    "function_name": "shortest_binary_grid",
    "signature": "shortest_binary_grid(grid: list[list[int]]) -> int",
    "description": "Find minimum four-directional moves from top-left to bottom-right through 0 cells (1 blocked); -1 if impossible.",
    "notes": "",
    "tags": [
      "graphs",
      "bfs"
    ],
    "examples": [
      {
        "case_id": "PY100-M17-T01",
        "input": [
          [
            [
              0,
              0
            ],
            [
              1,
              0
            ]
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M17-T02",
        "input": [
          [
            [
              0
            ]
          ]
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M17-T01",
        "input": [
          [
            [
              0,
              0
            ],
            [
              1,
              0
            ]
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M17-T02",
        "input": [
          [
            [
              0
            ]
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M17-T03",
        "input": [
          [
            [
              1
            ]
          ]
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-M17-T04",
        "input": [
          [
            [
              0,
              1
            ],
            [
              1,
              0
            ]
          ]
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-M17-T05",
        "input": [
          [
            [
              0,
              0,
              0
            ],
            [
              1,
              1,
              0
            ],
            [
              0,
              0,
              0
            ]
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M17-T06",
        "input": [
          [
            [
              0,
              0
            ],
            [
              0,
              1
            ]
          ]
        ],
        "expected": -1
      }
    ]
  },
  {
    "id": "PY100-M18",
    "difficulty": "medium",
    "slug": "component_sizes",
    "function_name": "component_sizes",
    "signature": "component_sizes(n: int, edges: list[list[int]]) -> list[int]",
    "description": "Undirected graph on nodes 0..n-1; return connected component sizes sorted ascending, counting isolated nodes.",
    "notes": "",
    "tags": [
      "graphs"
    ],
    "examples": [
      {
        "case_id": "PY100-M18-T01",
        "input": [
          5,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": [
          2,
          3
        ]
      },
      {
        "case_id": "PY100-M18-T02",
        "input": [
          3,
          []
        ],
        "expected": [
          1,
          1,
          1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M18-T01",
        "input": [
          5,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": [
          2,
          3
        ]
      },
      {
        "case_id": "PY100-M18-T02",
        "input": [
          3,
          []
        ],
        "expected": [
          1,
          1,
          1
        ]
      },
      {
        "case_id": "PY100-M18-T03",
        "input": [
          0,
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M18-T04",
        "input": [
          4,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ],
            [
              2,
              3
            ]
          ]
        ],
        "expected": [
          4
        ]
      },
      {
        "case_id": "PY100-M18-T05",
        "input": [
          4,
          [
            [
              0,
              1
            ],
            [
              0,
              1
            ]
          ]
        ],
        "expected": [
          1,
          1,
          2
        ]
      },
      {
        "case_id": "PY100-M18-T06",
        "input": [
          6,
          [
            [
              1,
              2
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": [
          1,
          1,
          2,
          2
        ]
      }
    ]
  },
  {
    "id": "PY100-M19",
    "difficulty": "medium",
    "slug": "valid_sudoku_partial",
    "function_name": "valid_sudoku_partial",
    "signature": "valid_sudoku_partial(board: list[str]) -> bool",
    "description": "9x9 rows of digits 1-9 or dots. Return whether every filled row, column, and 3x3 block has no duplicate digit.",
    "notes": "",
    "tags": [
      "matrix"
    ],
    "examples": [
      {
        "case_id": "PY100-M19-T01",
        "input": [
          [
            "53..7....",
            "6..195...",
            ".98....6.",
            "8...6...3",
            "4..8.3..1",
            "7...2...6",
            ".6....28.",
            "...419..5",
            "....8..79"
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M19-T02",
        "input": [
          [
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            "........."
          ]
        ],
        "expected": true
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M19-T01",
        "input": [
          [
            "53..7....",
            "6..195...",
            ".98....6.",
            "8...6...3",
            "4..8.3..1",
            "7...2...6",
            ".6....28.",
            "...419..5",
            "....8..79"
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M19-T02",
        "input": [
          [
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            "........."
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M19-T03",
        "input": [
          [
            "11.......",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            "........."
          ]
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M19-T04",
        "input": [
          [
            "1........",
            "1........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            "........."
          ]
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M19-T05",
        "input": [
          [
            "1........",
            ".1.......",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            ".........",
            "........."
          ]
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M19-T06",
        "input": [
          [
            "123456789",
            "123456789",
            "123456789",
            "123456789",
            "123456789",
            "123456789",
            "123456789",
            "123456789",
            "123456789"
          ]
        ],
        "expected": false
      }
    ]
  },
  {
    "id": "PY100-M20",
    "difficulty": "medium",
    "slug": "decode_digit_messages",
    "function_name": "decode_digit_messages",
    "signature": "decode_digit_messages(text: str) -> int",
    "description": "Count decodings of digit string using 1->A through 26->Z, no leading-zero codes. Empty string has 0 decodings.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M20-T01",
        "input": [
          "12"
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M20-T02",
        "input": [
          "226"
        ],
        "expected": 3
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M20-T01",
        "input": [
          "12"
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M20-T02",
        "input": [
          "226"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M20-T03",
        "input": [
          "06"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M20-T04",
        "input": [
          ""
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M20-T05",
        "input": [
          "10"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M20-T06",
        "input": [
          "11106"
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-M21",
    "difficulty": "medium",
    "slug": "climb_one_two",
    "function_name": "climb_one_two",
    "signature": "climb_one_two(n: int) -> int",
    "description": "Return number of ways to climb n steps using jumps of 1 or 2. n=0 has one empty way.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M21-T01",
        "input": [
          0
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M21-T02",
        "input": [
          1
        ],
        "expected": 1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M21-T01",
        "input": [
          0
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M21-T02",
        "input": [
          1
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M21-T03",
        "input": [
          2
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-M21-T04",
        "input": [
          3
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M21-T05",
        "input": [
          5
        ],
        "expected": 8
      },
      {
        "case_id": "PY100-M21-T06",
        "input": [
          20
        ],
        "expected": 10946
      }
    ]
  },
  {
    "id": "PY100-M22",
    "difficulty": "medium",
    "slug": "min_coin_change",
    "function_name": "min_coin_change",
    "signature": "min_coin_change(coins: list[int], amount: int) -> int",
    "description": "Unlimited positive coin denominations; return minimum coins to reach nonnegative amount, or -1.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M22-T01",
        "input": [
          [
            1,
            2,
            5
          ],
          11
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M22-T02",
        "input": [
          [
            2
          ],
          3
        ],
        "expected": -1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M22-T01",
        "input": [
          [
            1,
            2,
            5
          ],
          11
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M22-T02",
        "input": [
          [
            2
          ],
          3
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-M22-T03",
        "input": [
          [
            1
          ],
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M22-T04",
        "input": [
          [],
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M22-T05",
        "input": [
          [],
          4
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-M22-T06",
        "input": [
          [
            3,
            4
          ],
          6
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-M23",
    "difficulty": "medium",
    "slug": "lis_length",
    "function_name": "lis_length",
    "signature": "lis_length(nums: list[int]) -> int",
    "description": "Length of a strictly increasing (not necessarily contiguous) subsequence. Equal values do not extend.",
    "notes": "",
    "tags": [
      "dp",
      "binary-search"
    ],
    "examples": [
      {
        "case_id": "PY100-M23-T01",
        "input": [
          [
            10,
            9,
            2,
            5,
            3,
            7,
            101,
            18
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M23-T02",
        "input": [
          [
            0,
            1,
            0,
            3,
            2,
            3
          ]
        ],
        "expected": 4
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M23-T01",
        "input": [
          [
            10,
            9,
            2,
            5,
            3,
            7,
            101,
            18
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M23-T02",
        "input": [
          [
            0,
            1,
            0,
            3,
            2,
            3
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M23-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M23-T04",
        "input": [
          [
            7,
            7,
            7
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M23-T05",
        "input": [
          [
            -2,
            -1,
            0
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M23-T06",
        "input": [
          [
            5,
            4,
            3,
            2,
            1
          ]
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-M24",
    "difficulty": "medium",
    "slug": "edit_distance",
    "function_name": "edit_distance",
    "signature": "edit_distance(a: str, b: str) -> int",
    "description": "Minimum single-character insertions, deletions or substitutions to transform a into b.",
    "notes": "",
    "tags": [
      "dp",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-M24-T01",
        "input": [
          "horse",
          "ros"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M24-T02",
        "input": [
          "intention",
          "execution"
        ],
        "expected": 5
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M24-T01",
        "input": [
          "horse",
          "ros"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M24-T02",
        "input": [
          "intention",
          "execution"
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-M24-T03",
        "input": [
          "",
          "abc"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M24-T04",
        "input": [
          "abc",
          ""
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M24-T05",
        "input": [
          "same",
          "same"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M24-T06",
        "input": [
          "kitten",
          "sitting"
        ],
        "expected": 3
      }
    ]
  },
  {
    "id": "PY100-M25",
    "difficulty": "medium",
    "slug": "lcs_length",
    "function_name": "lcs_length",
    "signature": "lcs_length(a: str, b: str) -> int",
    "description": "Length of longest common subsequence, not necessarily contiguous.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M25-T01",
        "input": [
          "abcde",
          "ace"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M25-T02",
        "input": [
          "abc",
          "abc"
        ],
        "expected": 3
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M25-T01",
        "input": [
          "abcde",
          "ace"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M25-T02",
        "input": [
          "abc",
          "abc"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M25-T03",
        "input": [
          "abc",
          "def"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M25-T04",
        "input": [
          "",
          "abc"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M25-T05",
        "input": [
          "abba",
          "baba"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M25-T06",
        "input": [
          "abcd",
          "ad"
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-M26",
    "difficulty": "medium",
    "slug": "knapsack_01",
    "function_name": "knapsack_01",
    "signature": "knapsack_01(weights: list[int], values: list[int], capacity: int) -> int",
    "description": "Each item may be selected at most once, weight positive, value nonnegative; maximize total value within capacity.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M26-T01",
        "input": [
          [
            2,
            3,
            4
          ],
          [
            4,
            5,
            6
          ],
          5
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-M26-T02",
        "input": [
          [
            1,
            2
          ],
          [
            10,
            1
          ],
          0
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M26-T01",
        "input": [
          [
            2,
            3,
            4
          ],
          [
            4,
            5,
            6
          ],
          5
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-M26-T02",
        "input": [
          [
            1,
            2
          ],
          [
            10,
            1
          ],
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M26-T03",
        "input": [
          [],
          [],
          5
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M26-T04",
        "input": [
          [
            4
          ],
          [
            9
          ],
          4
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-M26-T05",
        "input": [
          [
            4
          ],
          [
            9
          ],
          3
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M26-T06",
        "input": [
          [
            1,
            1,
            1
          ],
          [
            1,
            2,
            3
          ],
          2
        ],
        "expected": 5
      }
    ]
  },
  {
    "id": "PY100-M27",
    "difficulty": "medium",
    "slug": "subset_sum_exists",
    "function_name": "subset_sum_exists",
    "signature": "subset_sum_exists(nums: list[int], target: int) -> bool",
    "description": "Determine whether any subset (including empty) sums to target; values may be negative.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M27-T01",
        "input": [
          [
            3,
            34,
            4,
            12,
            5,
            2
          ],
          9
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M27-T02",
        "input": [
          [
            3,
            34,
            4,
            12,
            5,
            2
          ],
          30
        ],
        "expected": false
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M27-T01",
        "input": [
          [
            3,
            34,
            4,
            12,
            5,
            2
          ],
          9
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M27-T02",
        "input": [
          [
            3,
            34,
            4,
            12,
            5,
            2
          ],
          30
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M27-T03",
        "input": [
          [],
          0
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M27-T04",
        "input": [
          [],
          1
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M27-T05",
        "input": [
          [
            -3,
            2,
            5
          ],
          -1
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M27-T06",
        "input": [
          [
            2,
            2,
            2
          ],
          4
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-M28",
    "difficulty": "medium",
    "slug": "equal_partition",
    "function_name": "equal_partition",
    "signature": "equal_partition(nums: list[int]) -> bool",
    "description": "Nonnegative integers; return whether they can be split into two subsets of equal sum; empty list is true.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M28-T01",
        "input": [
          [
            1,
            5,
            11,
            5
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M28-T02",
        "input": [
          [
            1,
            2,
            3,
            5
          ]
        ],
        "expected": false
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M28-T01",
        "input": [
          [
            1,
            5,
            11,
            5
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M28-T02",
        "input": [
          [
            1,
            2,
            3,
            5
          ]
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M28-T03",
        "input": [
          []
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M28-T04",
        "input": [
          [
            0,
            0
          ]
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M28-T05",
        "input": [
          [
            2,
            2,
            3,
            5
          ]
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M28-T06",
        "input": [
          [
            1,
            1
          ]
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-M29",
    "difficulty": "medium",
    "slug": "largest_histogram_rectangle",
    "function_name": "largest_histogram_rectangle",
    "signature": "largest_histogram_rectangle(heights: list[int]) -> int",
    "description": "Unit-width histogram bars with nonnegative heights. Return maximum axis-aligned rectangle area within bars.",
    "notes": "",
    "tags": [
      "stack"
    ],
    "examples": [
      {
        "case_id": "PY100-M29-T01",
        "input": [
          [
            2,
            1,
            5,
            6,
            2,
            3
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-M29-T02",
        "input": [
          []
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M29-T01",
        "input": [
          [
            2,
            1,
            5,
            6,
            2,
            3
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-M29-T02",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M29-T03",
        "input": [
          [
            2,
            4
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M29-T04",
        "input": [
          [
            0,
            0
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M29-T05",
        "input": [
          [
            5
          ]
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-M29-T06",
        "input": [
          [
            2,
            2,
            2
          ]
        ],
        "expected": 6
      }
    ]
  },
  {
    "id": "PY100-M30",
    "difficulty": "medium",
    "slug": "next_greater_right",
    "function_name": "next_greater_right",
    "signature": "next_greater_right(nums: list[int]) -> list[int]",
    "description": "For each element return first strictly greater value to its right, or -1.",
    "notes": "",
    "tags": [
      "stack"
    ],
    "examples": [
      {
        "case_id": "PY100-M30-T01",
        "input": [
          [
            2,
            1,
            2,
            4,
            3
          ]
        ],
        "expected": [
          4,
          2,
          4,
          -1,
          -1
        ]
      },
      {
        "case_id": "PY100-M30-T02",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": [
          2,
          3,
          -1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M30-T01",
        "input": [
          [
            2,
            1,
            2,
            4,
            3
          ]
        ],
        "expected": [
          4,
          2,
          4,
          -1,
          -1
        ]
      },
      {
        "case_id": "PY100-M30-T02",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": [
          2,
          3,
          -1
        ]
      },
      {
        "case_id": "PY100-M30-T03",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M30-T04",
        "input": [
          [
            3,
            2,
            1
          ]
        ],
        "expected": [
          -1,
          -1,
          -1
        ]
      },
      {
        "case_id": "PY100-M30-T05",
        "input": [
          [
            2,
            2,
            3
          ]
        ],
        "expected": [
          3,
          3,
          -1
        ]
      },
      {
        "case_id": "PY100-M30-T06",
        "input": [
          [
            -3,
            -1,
            -2
          ]
        ],
        "expected": [
          -1,
          -1,
          -1
        ]
      }
    ]
  },
  {
    "id": "PY100-M31",
    "difficulty": "medium",
    "slug": "days_until_warmer",
    "function_name": "days_until_warmer",
    "signature": "days_until_warmer(temperatures: list[int]) -> list[int]",
    "description": "For each day return days until a strictly warmer future temperature, or 0.",
    "notes": "",
    "tags": [
      "stack"
    ],
    "examples": [
      {
        "case_id": "PY100-M31-T01",
        "input": [
          [
            73,
            74,
            75,
            71,
            69,
            72,
            76,
            73
          ]
        ],
        "expected": [
          1,
          1,
          4,
          2,
          1,
          1,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-M31-T02",
        "input": [
          []
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M31-T01",
        "input": [
          [
            73,
            74,
            75,
            71,
            69,
            72,
            76,
            73
          ]
        ],
        "expected": [
          1,
          1,
          4,
          2,
          1,
          1,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-M31-T02",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M31-T03",
        "input": [
          [
            30,
            40,
            50
          ]
        ],
        "expected": [
          1,
          1,
          0
        ]
      },
      {
        "case_id": "PY100-M31-T04",
        "input": [
          [
            50,
            40,
            30
          ]
        ],
        "expected": [
          0,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-M31-T05",
        "input": [
          [
            20,
            20,
            21
          ]
        ],
        "expected": [
          2,
          1,
          0
        ]
      },
      {
        "case_id": "PY100-M31-T06",
        "input": [
          [
            90
          ]
        ],
        "expected": [
          0
        ]
      }
    ]
  },
  {
    "id": "PY100-M32",
    "difficulty": "medium",
    "slug": "sorted_anagram_groups",
    "function_name": "sorted_anagram_groups",
    "signature": "sorted_anagram_groups(words: list[str]) -> list[list[str]]",
    "description": "Group exact-case anagrams; sort words within each group; sort groups by their first word alphabetically. Empty input returns [].",
    "notes": "",
    "tags": [
      "hashmap"
    ],
    "examples": [
      {
        "case_id": "PY100-M32-T01",
        "input": [
          [
            "eat",
            "tea",
            "tan",
            "ate",
            "nat",
            "bat"
          ]
        ],
        "expected": [
          [
            "ate",
            "eat",
            "tea"
          ],
          [
            "bat"
          ],
          [
            "nat",
            "tan"
          ]
        ]
      },
      {
        "case_id": "PY100-M32-T02",
        "input": [
          []
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M32-T01",
        "input": [
          [
            "eat",
            "tea",
            "tan",
            "ate",
            "nat",
            "bat"
          ]
        ],
        "expected": [
          [
            "ate",
            "eat",
            "tea"
          ],
          [
            "bat"
          ],
          [
            "nat",
            "tan"
          ]
        ]
      },
      {
        "case_id": "PY100-M32-T02",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M32-T03",
        "input": [
          [
            "",
            ""
          ]
        ],
        "expected": [
          [
            "",
            ""
          ]
        ]
      },
      {
        "case_id": "PY100-M32-T04",
        "input": [
          [
            "abc",
            "bca",
            "cab",
            "xyz"
          ]
        ],
        "expected": [
          [
            "abc",
            "bca",
            "cab"
          ],
          [
            "xyz"
          ]
        ]
      },
      {
        "case_id": "PY100-M32-T05",
        "input": [
          [
            "a",
            "A"
          ]
        ],
        "expected": [
          [
            "A"
          ],
          [
            "a"
          ]
        ]
      },
      {
        "case_id": "PY100-M32-T06",
        "input": [
          [
            "ab",
            "ba",
            "a",
            "b"
          ]
        ],
        "expected": [
          [
            "a"
          ],
          [
            "ab",
            "ba"
          ],
          [
            "b"
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-M33",
    "difficulty": "medium",
    "slug": "top_k_frequent_words",
    "function_name": "top_k_frequent_words",
    "signature": "top_k_frequent_words(words: list[str], k: int) -> list[str]",
    "description": "Return at most k distinct words by descending frequency, breaking ties alphabetically; k>=0.",
    "notes": "",
    "tags": [
      "hashmap",
      "sorting"
    ],
    "examples": [
      {
        "case_id": "PY100-M33-T01",
        "input": [
          [
            "i",
            "love",
            "leetcode",
            "i",
            "love",
            "coding"
          ],
          2
        ],
        "expected": [
          "i",
          "love"
        ]
      },
      {
        "case_id": "PY100-M33-T02",
        "input": [
          [
            "b",
            "a",
            "b",
            "c",
            "a"
          ],
          3
        ],
        "expected": [
          "a",
          "b",
          "c"
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M33-T01",
        "input": [
          [
            "i",
            "love",
            "leetcode",
            "i",
            "love",
            "coding"
          ],
          2
        ],
        "expected": [
          "i",
          "love"
        ]
      },
      {
        "case_id": "PY100-M33-T02",
        "input": [
          [
            "b",
            "a",
            "b",
            "c",
            "a"
          ],
          3
        ],
        "expected": [
          "a",
          "b",
          "c"
        ]
      },
      {
        "case_id": "PY100-M33-T03",
        "input": [
          [],
          2
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M33-T04",
        "input": [
          [
            "a"
          ],
          0
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M33-T05",
        "input": [
          [
            "z",
            "y",
            "x"
          ],
          2
        ],
        "expected": [
          "x",
          "y"
        ]
      },
      {
        "case_id": "PY100-M33-T06",
        "input": [
          [
            "a",
            "a",
            "b"
          ],
          5
        ],
        "expected": [
          "a",
          "b"
        ]
      }
    ]
  },
  {
    "id": "PY100-M34",
    "difficulty": "medium",
    "slug": "simplify_unix_path",
    "function_name": "simplify_unix_path",
    "signature": "simplify_unix_path(path: str) -> str",
    "description": "Canonicalize absolute Unix path by collapsing repeated slashes, . and ..; root cannot be traversed above.",
    "notes": "",
    "tags": [
      "stack",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-M34-T01",
        "input": [
          "/home/"
        ],
        "expected": "/home"
      },
      {
        "case_id": "PY100-M34-T02",
        "input": [
          "/../"
        ],
        "expected": "/"
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M34-T01",
        "input": [
          "/home/"
        ],
        "expected": "/home"
      },
      {
        "case_id": "PY100-M34-T02",
        "input": [
          "/../"
        ],
        "expected": "/"
      },
      {
        "case_id": "PY100-M34-T03",
        "input": [
          "/home//foo/"
        ],
        "expected": "/home/foo"
      },
      {
        "case_id": "PY100-M34-T04",
        "input": [
          "/a/./b/../../c/"
        ],
        "expected": "/c"
      },
      {
        "case_id": "PY100-M34-T05",
        "input": [
          "/"
        ],
        "expected": "/"
      },
      {
        "case_id": "PY100-M34-T06",
        "input": [
          "/a/.../b"
        ],
        "expected": "/a/.../b"
      }
    ]
  },
  {
    "id": "PY100-M35",
    "difficulty": "medium",
    "slug": "minimum_cover_window",
    "function_name": "minimum_cover_window",
    "signature": "minimum_cover_window(text: str, chars: str) -> str",
    "description": "Shortest substring containing every character of chars with multiplicity. Tie: earliest start. Return empty if impossible or chars empty.",
    "notes": "",
    "tags": [
      "sliding-window"
    ],
    "examples": [
      {
        "case_id": "PY100-M35-T01",
        "input": [
          "ADOBECODEBANC",
          "ABC"
        ],
        "expected": "BANC"
      },
      {
        "case_id": "PY100-M35-T02",
        "input": [
          "a",
          "aa"
        ],
        "expected": ""
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M35-T01",
        "input": [
          "ADOBECODEBANC",
          "ABC"
        ],
        "expected": "BANC"
      },
      {
        "case_id": "PY100-M35-T02",
        "input": [
          "a",
          "aa"
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-M35-T03",
        "input": [
          "abc",
          ""
        ],
        "expected": ""
      },
      {
        "case_id": "PY100-M35-T04",
        "input": [
          "aaab",
          "aab"
        ],
        "expected": "aab"
      },
      {
        "case_id": "PY100-M35-T05",
        "input": [
          "abcbc",
          "bc"
        ],
        "expected": "bc"
      },
      {
        "case_id": "PY100-M35-T06",
        "input": [
          "xyzabc",
          "cb"
        ],
        "expected": "bc"
      }
    ]
  },
  {
    "id": "PY100-M36",
    "difficulty": "medium",
    "slug": "valid_ipv4",
    "function_name": "valid_ipv4",
    "signature": "valid_ipv4(text: str) -> bool",
    "description": "Validate strict dotted-decimal IPv4: 4 segments each 0..255; no leading zero except literal 0; ASCII digits only.",
    "notes": "",
    "tags": [
      "parsing"
    ],
    "examples": [
      {
        "case_id": "PY100-M36-T01",
        "input": [
          "192.168.0.1"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M36-T02",
        "input": [
          "01.2.3.4"
        ],
        "expected": false
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M36-T01",
        "input": [
          "192.168.0.1"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M36-T02",
        "input": [
          "01.2.3.4"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M36-T03",
        "input": [
          "256.1.1.1"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M36-T04",
        "input": [
          "0.0.0.0"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-M36-T05",
        "input": [
          "1.2.3"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-M36-T06",
        "input": [
          "1.2.3.a"
        ],
        "expected": false
      }
    ]
  },
  {
    "id": "PY100-M37",
    "difficulty": "medium",
    "slug": "compare_versions",
    "function_name": "compare_versions",
    "signature": "compare_versions(a: str, b: str) -> int",
    "description": "Dot-separated nonnegative integer version components; trailing zero components ignored. Return -1, 0 or 1.",
    "notes": "",
    "tags": [
      "parsing"
    ],
    "examples": [
      {
        "case_id": "PY100-M37-T01",
        "input": [
          "1.01",
          "1.001"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M37-T02",
        "input": [
          "1.0",
          "1.0.0"
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M37-T01",
        "input": [
          "1.01",
          "1.001"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M37-T02",
        "input": [
          "1.0",
          "1.0.0"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M37-T03",
        "input": [
          "0.1",
          "1.1"
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-M37-T04",
        "input": [
          "1.2",
          "1.1.9"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M37-T05",
        "input": [
          "10.0",
          "2.9"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M37-T06",
        "input": [
          "1.0.1",
          "1"
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-M38",
    "difficulty": "medium",
    "slug": "evaluate_rpn",
    "function_name": "evaluate_rpn",
    "signature": "evaluate_rpn(tokens: list[str]) -> int",
    "description": "Evaluate valid Reverse Polish notation with +,-,*,/; integer division truncates toward zero; no division by zero.",
    "notes": "",
    "tags": [
      "stack"
    ],
    "examples": [
      {
        "case_id": "PY100-M38-T01",
        "input": [
          [
            "2",
            "1",
            "+",
            "3",
            "*"
          ]
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-M38-T02",
        "input": [
          [
            "4",
            "13",
            "5",
            "/",
            "+"
          ]
        ],
        "expected": 6
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M38-T01",
        "input": [
          [
            "2",
            "1",
            "+",
            "3",
            "*"
          ]
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-M38-T02",
        "input": [
          [
            "4",
            "13",
            "5",
            "/",
            "+"
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-M38-T03",
        "input": [
          [
            "-7",
            "2",
            "/"
          ]
        ],
        "expected": -3
      },
      {
        "case_id": "PY100-M38-T04",
        "input": [
          [
            "5"
          ]
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-M38-T05",
        "input": [
          [
            "8",
            "3",
            "-",
            "2",
            "*"
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-M38-T06",
        "input": [
          [
            "10",
            "6",
            "9",
            "3",
            "+",
            "-11",
            "*",
            "/",
            "*",
            "17",
            "+",
            "5",
            "+"
          ]
        ],
        "expected": 22
      }
    ]
  },
  {
    "id": "PY100-M39",
    "difficulty": "medium",
    "slug": "unique_permutations",
    "function_name": "unique_permutations",
    "signature": "unique_permutations(nums: list[int]) -> list[list[int]]",
    "description": "Return all distinct permutations sorted lexicographically, each permutation as a list. Input length <=7.",
    "notes": "",
    "tags": [
      "backtracking"
    ],
    "examples": [
      {
        "case_id": "PY100-M39-T01",
        "input": [
          [
            1,
            1,
            2
          ]
        ],
        "expected": [
          [
            1,
            1,
            2
          ],
          [
            1,
            2,
            1
          ],
          [
            2,
            1,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M39-T02",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": [
          [
            1,
            2,
            3
          ],
          [
            1,
            3,
            2
          ],
          [
            2,
            1,
            3
          ],
          [
            2,
            3,
            1
          ],
          [
            3,
            1,
            2
          ],
          [
            3,
            2,
            1
          ]
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M39-T01",
        "input": [
          [
            1,
            1,
            2
          ]
        ],
        "expected": [
          [
            1,
            1,
            2
          ],
          [
            1,
            2,
            1
          ],
          [
            2,
            1,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M39-T02",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": [
          [
            1,
            2,
            3
          ],
          [
            1,
            3,
            2
          ],
          [
            2,
            1,
            3
          ],
          [
            2,
            3,
            1
          ],
          [
            3,
            1,
            2
          ],
          [
            3,
            2,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M39-T03",
        "input": [
          []
        ],
        "expected": [
          []
        ]
      },
      {
        "case_id": "PY100-M39-T04",
        "input": [
          [
            5
          ]
        ],
        "expected": [
          [
            5
          ]
        ]
      },
      {
        "case_id": "PY100-M39-T05",
        "input": [
          [
            2,
            2
          ]
        ],
        "expected": [
          [
            2,
            2
          ]
        ]
      },
      {
        "case_id": "PY100-M39-T06",
        "input": [
          [
            0,
            -1,
            0
          ]
        ],
        "expected": [
          [
            -1,
            0,
            0
          ],
          [
            0,
            -1,
            0
          ],
          [
            0,
            0,
            -1
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-M40",
    "difficulty": "medium",
    "slug": "combinations_k",
    "function_name": "combinations_k",
    "signature": "combinations_k(n: int, k: int) -> list[list[int]]",
    "description": "Generate lexicographically sorted k-element strictly increasing combinations from numbers 1..n; 0<=k<=n<=10.",
    "notes": "",
    "tags": [
      "backtracking"
    ],
    "examples": [
      {
        "case_id": "PY100-M40-T01",
        "input": [
          4,
          2
        ],
        "expected": [
          [
            1,
            2
          ],
          [
            1,
            3
          ],
          [
            1,
            4
          ],
          [
            2,
            3
          ],
          [
            2,
            4
          ],
          [
            3,
            4
          ]
        ]
      },
      {
        "case_id": "PY100-M40-T02",
        "input": [
          1,
          1
        ],
        "expected": [
          [
            1
          ]
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M40-T01",
        "input": [
          4,
          2
        ],
        "expected": [
          [
            1,
            2
          ],
          [
            1,
            3
          ],
          [
            1,
            4
          ],
          [
            2,
            3
          ],
          [
            2,
            4
          ],
          [
            3,
            4
          ]
        ]
      },
      {
        "case_id": "PY100-M40-T02",
        "input": [
          1,
          1
        ],
        "expected": [
          [
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M40-T03",
        "input": [
          3,
          0
        ],
        "expected": [
          []
        ]
      },
      {
        "case_id": "PY100-M40-T04",
        "input": [
          0,
          0
        ],
        "expected": [
          []
        ]
      },
      {
        "case_id": "PY100-M40-T05",
        "input": [
          5,
          5
        ],
        "expected": [
          [
            1,
            2,
            3,
            4,
            5
          ]
        ]
      },
      {
        "case_id": "PY100-M40-T06",
        "input": [
          5,
          1
        ],
        "expected": [
          [
            1
          ],
          [
            2
          ],
          [
            3
          ],
          [
            4
          ],
          [
            5
          ]
        ]
      }
    ]
  },
  {
    "id": "PY100-M41",
    "difficulty": "medium",
    "slug": "phone_keypad_words",
    "function_name": "phone_keypad_words",
    "signature": "phone_keypad_words(digits: str) -> list[str]",
    "description": "Digits 2..9; return phone keypad letter combinations in lexicographic order, or [] for empty input.",
    "notes": "",
    "tags": [
      "backtracking"
    ],
    "examples": [
      {
        "case_id": "PY100-M41-T01",
        "input": [
          "23"
        ],
        "expected": [
          "ad",
          "ae",
          "af",
          "bd",
          "be",
          "bf",
          "cd",
          "ce",
          "cf"
        ]
      },
      {
        "case_id": "PY100-M41-T02",
        "input": [
          ""
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M41-T01",
        "input": [
          "23"
        ],
        "expected": [
          "ad",
          "ae",
          "af",
          "bd",
          "be",
          "bf",
          "cd",
          "ce",
          "cf"
        ]
      },
      {
        "case_id": "PY100-M41-T02",
        "input": [
          ""
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M41-T03",
        "input": [
          "2"
        ],
        "expected": [
          "a",
          "b",
          "c"
        ]
      },
      {
        "case_id": "PY100-M41-T04",
        "input": [
          "79"
        ],
        "expected": [
          "pw",
          "px",
          "py",
          "pz",
          "qw",
          "qx",
          "qy",
          "qz",
          "rw",
          "rx",
          "ry",
          "rz",
          "sw",
          "sx",
          "sy",
          "sz"
        ]
      },
      {
        "case_id": "PY100-M41-T05",
        "input": [
          "222"
        ],
        "expected": [
          "aaa",
          "aab",
          "aac",
          "aba",
          "abb",
          "abc",
          "aca",
          "acb",
          "acc",
          "baa",
          "bab",
          "bac",
          "bba",
          "bbb",
          "bbc",
          "bca",
          "bcb",
          "bcc",
          "caa",
          "cab",
          "cac",
          "cba",
          "cbb",
          "cbc",
          "cca",
          "ccb",
          "ccc"
        ]
      },
      {
        "case_id": "PY100-M41-T06",
        "input": [
          ""
        ],
        "expected": []
      }
    ]
  },
  {
    "id": "PY100-M42",
    "difficulty": "medium",
    "slug": "kth_largest_with_duplicates",
    "function_name": "kth_largest_with_duplicates",
    "signature": "kth_largest_with_duplicates(nums: list[int], k: int) -> int",
    "description": "Return kth largest element counting duplicates; 1<=k<=len(nums).",
    "notes": "",
    "tags": [
      "sorting",
      "heap"
    ],
    "examples": [
      {
        "case_id": "PY100-M42-T01",
        "input": [
          [
            3,
            2,
            1,
            5,
            6,
            4
          ],
          2
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-M42-T02",
        "input": [
          [
            3,
            2,
            3,
            1,
            2,
            4,
            5,
            5,
            6
          ],
          4
        ],
        "expected": 4
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M42-T01",
        "input": [
          [
            3,
            2,
            1,
            5,
            6,
            4
          ],
          2
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-M42-T02",
        "input": [
          [
            3,
            2,
            3,
            1,
            2,
            4,
            5,
            5,
            6
          ],
          4
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M42-T03",
        "input": [
          [
            1
          ],
          1
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-M42-T04",
        "input": [
          [
            0,
            0
          ],
          2
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M42-T05",
        "input": [
          [
            -1,
            -5,
            -2
          ],
          3
        ],
        "expected": -5
      },
      {
        "case_id": "PY100-M42-T06",
        "input": [
          [
            9,
            8,
            7
          ],
          1
        ],
        "expected": 9
      }
    ]
  },
  {
    "id": "PY100-M43",
    "difficulty": "medium",
    "slug": "k_closest_points",
    "function_name": "k_closest_points",
    "signature": "k_closest_points(points: list[list[int]], k: int) -> list[list[int]]",
    "description": "Return k points closest to origin by squared distance; break ties by x then y, preserving duplicates.",
    "notes": "",
    "tags": [
      "heap",
      "geometry"
    ],
    "examples": [
      {
        "case_id": "PY100-M43-T01",
        "input": [
          [
            [
              1,
              3
            ],
            [
              -2,
              2
            ]
          ],
          1
        ],
        "expected": [
          [
            -2,
            2
          ]
        ]
      },
      {
        "case_id": "PY100-M43-T02",
        "input": [
          [
            [
              3,
              3
            ],
            [
              5,
              -1
            ],
            [
              -2,
              4
            ]
          ],
          2
        ],
        "expected": [
          [
            3,
            3
          ],
          [
            -2,
            4
          ]
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M43-T01",
        "input": [
          [
            [
              1,
              3
            ],
            [
              -2,
              2
            ]
          ],
          1
        ],
        "expected": [
          [
            -2,
            2
          ]
        ]
      },
      {
        "case_id": "PY100-M43-T02",
        "input": [
          [
            [
              3,
              3
            ],
            [
              5,
              -1
            ],
            [
              -2,
              4
            ]
          ],
          2
        ],
        "expected": [
          [
            3,
            3
          ],
          [
            -2,
            4
          ]
        ]
      },
      {
        "case_id": "PY100-M43-T03",
        "input": [
          [],
          0
        ],
        "expected": []
      },
      {
        "case_id": "PY100-M43-T04",
        "input": [
          [
            [
              1,
              0
            ],
            [
              -1,
              0
            ],
            [
              0,
              1
            ]
          ],
          2
        ],
        "expected": [
          [
            -1,
            0
          ],
          [
            0,
            1
          ]
        ]
      },
      {
        "case_id": "PY100-M43-T05",
        "input": [
          [
            [
              0,
              0
            ]
          ],
          1
        ],
        "expected": [
          [
            0,
            0
          ]
        ]
      },
      {
        "case_id": "PY100-M43-T06",
        "input": [
          [
            [
              5,
              5
            ],
            [
              2,
              2
            ]
          ],
          0
        ],
        "expected": []
      }
    ]
  },
  {
    "id": "PY100-M44",
    "difficulty": "medium",
    "slug": "count_inversions",
    "function_name": "count_inversions",
    "signature": "count_inversions(nums: list[int]) -> int",
    "description": "Count pairs i<j with nums[i]>nums[j]. Equal elements do not count.",
    "notes": "",
    "tags": [
      "divide-conquer"
    ],
    "examples": [
      {
        "case_id": "PY100-M44-T01",
        "input": [
          [
            2,
            4,
            1,
            3,
            5
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M44-T02",
        "input": [
          []
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M44-T01",
        "input": [
          [
            2,
            4,
            1,
            3,
            5
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M44-T02",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M44-T03",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M44-T04",
        "input": [
          [
            3,
            2,
            1
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-M44-T05",
        "input": [
          [
            1,
            1,
            1
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M44-T06",
        "input": [
          [
            -1,
            -3,
            -2
          ]
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-M45",
    "difficulty": "medium",
    "slug": "two_stock_transactions",
    "function_name": "two_stock_transactions",
    "signature": "two_stock_transactions(prices: list[int]) -> int",
    "description": "Max profit with at most two nonoverlapping buy-sell transactions; cannot hold two shares simultaneously.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-M45-T01",
        "input": [
          [
            3,
            3,
            5,
            0,
            0,
            3,
            1,
            4
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-M45-T02",
        "input": [
          [
            1,
            2,
            3,
            4,
            5
          ]
        ],
        "expected": 4
      }
    ],
    "tests": [
      {
        "case_id": "PY100-M45-T01",
        "input": [
          [
            3,
            3,
            5,
            0,
            0,
            3,
            1,
            4
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-M45-T02",
        "input": [
          [
            1,
            2,
            3,
            4,
            5
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-M45-T03",
        "input": [
          [
            7,
            6,
            4,
            3,
            1
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M45-T04",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M45-T05",
        "input": [
          [
            1
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-M45-T06",
        "input": [
          [
            2,
            1,
            2,
            0,
            1
          ]
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-H01",
    "difficulty": "hard",
    "slug": "minimum_word_break",
    "function_name": "minimum_word_break",
    "signature": "minimum_word_break(text: str, dictionary: list[str]) -> int",
    "description": "Minimum number of nonempty dictionary words concatenated to form text exactly, with unlimited reuse; -1 if impossible, 0 for empty text.",
    "notes": "",
    "tags": [
      "dp",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-H01-T01",
        "input": [
          "leetcode",
          [
            "leet",
            "code"
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H01-T02",
        "input": [
          "catsanddog",
          [
            "cats",
            "cat",
            "and",
            "sand",
            "dog"
          ]
        ],
        "expected": 3
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H01-T01",
        "input": [
          "leetcode",
          [
            "leet",
            "code"
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H01-T02",
        "input": [
          "catsanddog",
          [
            "cats",
            "cat",
            "and",
            "sand",
            "dog"
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-H01-T03",
        "input": [
          "catsandog",
          [
            "cats",
            "dog",
            "sand",
            "and",
            "cat"
          ]
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-H01-T04",
        "input": [
          "",
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H01-T05",
        "input": [
          "aaaaa",
          [
            "a",
            "aa",
            "aaa"
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H01-T06",
        "input": [
          "abc",
          [
            "ab",
            "bc"
          ]
        ],
        "expected": -1
      }
    ]
  },
  {
    "id": "PY100-H02",
    "difficulty": "hard",
    "slug": "wildcard_match",
    "function_name": "wildcard_match",
    "signature": "wildcard_match(text: str, pattern: str) -> bool",
    "description": "Match entire text to wildcard pattern: ? matches one character, * matches any sequence including empty; all other characters literal.",
    "notes": "",
    "tags": [
      "dp",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-H02-T01",
        "input": [
          "aa",
          "a"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-H02-T02",
        "input": [
          "aa",
          "*"
        ],
        "expected": true
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H02-T01",
        "input": [
          "aa",
          "a"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-H02-T02",
        "input": [
          "aa",
          "*"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-H02-T03",
        "input": [
          "cb",
          "?a"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-H02-T04",
        "input": [
          "adceb",
          "*a*b"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-H02-T05",
        "input": [
          "acdcb",
          "a*c?b"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-H02-T06",
        "input": [
          "",
          "*"
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-H03",
    "difficulty": "hard",
    "slug": "simple_regex_fullmatch",
    "function_name": "simple_regex_fullmatch",
    "signature": "simple_regex_fullmatch(text: str, pattern: str) -> bool",
    "description": "Full match using . for any single character and * for zero or more of immediately preceding atom. Pattern guaranteed valid (no leading or consecutive *).",
    "notes": "",
    "tags": [
      "dp",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-H03-T01",
        "input": [
          "aa",
          "a"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-H03-T02",
        "input": [
          "aa",
          "a*"
        ],
        "expected": true
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H03-T01",
        "input": [
          "aa",
          "a"
        ],
        "expected": false
      },
      {
        "case_id": "PY100-H03-T02",
        "input": [
          "aa",
          "a*"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-H03-T03",
        "input": [
          "ab",
          ".*"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-H03-T04",
        "input": [
          "aab",
          "c*a*b"
        ],
        "expected": true
      },
      {
        "case_id": "PY100-H03-T05",
        "input": [
          "mississippi",
          "mis*is*p*."
        ],
        "expected": false
      },
      {
        "case_id": "PY100-H03-T06",
        "input": [
          "",
          "a*"
        ],
        "expected": true
      }
    ]
  },
  {
    "id": "PY100-H04",
    "difficulty": "hard",
    "slug": "count_distinct_subsequences",
    "function_name": "count_distinct_subsequences",
    "signature": "count_distinct_subsequences(source: str, target: str) -> int",
    "description": "Number of index-distinct subsequences of source exactly equal to target. Empty target has one subsequence.",
    "notes": "",
    "tags": [
      "dp",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-H04-T01",
        "input": [
          "rabbbit",
          "rabbit"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-H04-T02",
        "input": [
          "babgbag",
          "bag"
        ],
        "expected": 5
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H04-T01",
        "input": [
          "rabbbit",
          "rabbit"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-H04-T02",
        "input": [
          "babgbag",
          "bag"
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-H04-T03",
        "input": [
          "",
          ""
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H04-T04",
        "input": [
          "abc",
          ""
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H04-T05",
        "input": [
          "",
          "a"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H04-T06",
        "input": [
          "aaaa",
          "aa"
        ],
        "expected": 6
      }
    ]
  },
  {
    "id": "PY100-H05",
    "difficulty": "hard",
    "slug": "count_palindrome_substrings",
    "function_name": "count_palindrome_substrings",
    "signature": "count_palindrome_substrings(text: str) -> int",
    "description": "Count all nonempty palindromic substrings by their positions (repeats count separately).",
    "notes": "",
    "tags": [
      "dp",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-H05-T01",
        "input": [
          "abc"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-H05-T02",
        "input": [
          "aaa"
        ],
        "expected": 6
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H05-T01",
        "input": [
          "abc"
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-H05-T02",
        "input": [
          "aaa"
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-H05-T03",
        "input": [
          ""
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H05-T04",
        "input": [
          "abba"
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-H05-T05",
        "input": [
          "ababa"
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-H05-T06",
        "input": [
          "aA"
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-H06",
    "difficulty": "hard",
    "slug": "longest_palindrome_subsequence",
    "function_name": "longest_palindrome_subsequence",
    "signature": "longest_palindrome_subsequence(text: str) -> int",
    "description": "Length of longest palindromic subsequence, not necessarily contiguous.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-H06-T01",
        "input": [
          "bbbab"
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H06-T02",
        "input": [
          "cbbd"
        ],
        "expected": 2
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H06-T01",
        "input": [
          "bbbab"
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H06-T02",
        "input": [
          "cbbd"
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H06-T03",
        "input": [
          ""
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H06-T04",
        "input": [
          "a"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H06-T05",
        "input": [
          "character"
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-H06-T06",
        "input": [
          "agbdba"
        ],
        "expected": 5
      }
    ]
  },
  {
    "id": "PY100-H07",
    "difficulty": "hard",
    "slug": "matrix_chain_min_cost",
    "function_name": "matrix_chain_min_cost",
    "signature": "matrix_chain_min_cost(dimensions: list[int]) -> int",
    "description": "n matrices have dimensions p[i] by p[i+1]. Return minimum scalar multiplication count over all parenthesizations. Positive dimensions, len>=2.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-H07-T01",
        "input": [
          [
            10,
            30,
            5,
            60
          ]
        ],
        "expected": 4500
      },
      {
        "case_id": "PY100-H07-T02",
        "input": [
          [
            40,
            20,
            30,
            10,
            30
          ]
        ],
        "expected": 26000
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H07-T01",
        "input": [
          [
            10,
            30,
            5,
            60
          ]
        ],
        "expected": 4500
      },
      {
        "case_id": "PY100-H07-T02",
        "input": [
          [
            40,
            20,
            30,
            10,
            30
          ]
        ],
        "expected": 26000
      },
      {
        "case_id": "PY100-H07-T03",
        "input": [
          [
            10,
            20
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H07-T04",
        "input": [
          [
            1,
            1,
            1,
            1
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H07-T05",
        "input": [
          [
            5,
            10,
            3,
            12,
            5,
            50,
            6
          ]
        ],
        "expected": 2010
      },
      {
        "case_id": "PY100-H07-T06",
        "input": [
          [
            30,
            35,
            15,
            5,
            10,
            20,
            25
          ]
        ],
        "expected": 15125
      }
    ]
  },
  {
    "id": "PY100-H08",
    "difficulty": "hard",
    "slug": "burst_balloons_max",
    "function_name": "burst_balloons_max",
    "signature": "burst_balloons_max(nums: list[int]) -> int",
    "description": "Burst positive integer balloons in any order; coins = value of balloon times adjacent remaining values, boundary neighbors count as 1. Maximize coins.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-H08-T01",
        "input": [
          [
            3,
            1,
            5,
            8
          ]
        ],
        "expected": 167
      },
      {
        "case_id": "PY100-H08-T02",
        "input": [
          [
            1,
            5
          ]
        ],
        "expected": 10
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H08-T01",
        "input": [
          [
            3,
            1,
            5,
            8
          ]
        ],
        "expected": 167
      },
      {
        "case_id": "PY100-H08-T02",
        "input": [
          [
            1,
            5
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-H08-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H08-T04",
        "input": [
          [
            1
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H08-T05",
        "input": [
          [
            2,
            2,
            2
          ]
        ],
        "expected": 14
      },
      {
        "case_id": "PY100-H08-T06",
        "input": [
          [
            1,
            2,
            3
          ]
        ],
        "expected": 12
      }
    ]
  },
  {
    "id": "PY100-H09",
    "difficulty": "hard",
    "slug": "weighted_job_scheduling",
    "function_name": "weighted_job_scheduling",
    "signature": "weighted_job_scheduling(jobs: list[list[int]]) -> int",
    "description": "Each job [start,end,profit], start<end, profit>=0; choose nonoverlapping half-open jobs maximizing profit. End==next start allowed.",
    "notes": "",
    "tags": [
      "dp",
      "binary-search"
    ],
    "examples": [
      {
        "case_id": "PY100-H09-T01",
        "input": [
          [
            [
              1,
              3,
              50
            ],
            [
              2,
              4,
              10
            ],
            [
              3,
              5,
              40
            ],
            [
              3,
              6,
              70
            ]
          ]
        ],
        "expected": 120
      },
      {
        "case_id": "PY100-H09-T02",
        "input": [
          [
            [
              1,
              2,
              10
            ],
            [
              2,
              3,
              20
            ]
          ]
        ],
        "expected": 30
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H09-T01",
        "input": [
          [
            [
              1,
              3,
              50
            ],
            [
              2,
              4,
              10
            ],
            [
              3,
              5,
              40
            ],
            [
              3,
              6,
              70
            ]
          ]
        ],
        "expected": 120
      },
      {
        "case_id": "PY100-H09-T02",
        "input": [
          [
            [
              1,
              2,
              10
            ],
            [
              2,
              3,
              20
            ]
          ]
        ],
        "expected": 30
      },
      {
        "case_id": "PY100-H09-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H09-T04",
        "input": [
          [
            [
              1,
              5,
              10
            ],
            [
              2,
              3,
              5
            ],
            [
              3,
              4,
              5
            ]
          ]
        ],
        "expected": 10
      },
      {
        "case_id": "PY100-H09-T05",
        "input": [
          [
            [
              1,
              2,
              0
            ]
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H09-T06",
        "input": [
          [
            [
              0,
              2,
              2
            ],
            [
              1,
              3,
              3
            ],
            [
              3,
              4,
              4
            ]
          ]
        ],
        "expected": 7
      }
    ]
  },
  {
    "id": "PY100-H10",
    "difficulty": "hard",
    "slug": "minimum_jump_count",
    "function_name": "minimum_jump_count",
    "signature": "minimum_jump_count(nums: list[int]) -> int",
    "description": "nums[i] gives max forward jump length. Return minimum jumps from index 0 to last index, -1 if unreachable; empty list returns 0.",
    "notes": "",
    "tags": [
      "greedy",
      "graphs"
    ],
    "examples": [
      {
        "case_id": "PY100-H10-T01",
        "input": [
          [
            2,
            3,
            1,
            1,
            4
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H10-T02",
        "input": [
          [
            3,
            2,
            1,
            0,
            4
          ]
        ],
        "expected": -1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H10-T01",
        "input": [
          [
            2,
            3,
            1,
            1,
            4
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H10-T02",
        "input": [
          [
            3,
            2,
            1,
            0,
            4
          ]
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-H10-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H10-T04",
        "input": [
          [
            0
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H10-T05",
        "input": [
          [
            1,
            1,
            1,
            1
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-H10-T06",
        "input": [
          [
            2,
            0,
            0
          ]
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-H11",
    "difficulty": "hard",
    "slug": "trap_rain_water",
    "function_name": "trap_rain_water",
    "signature": "trap_rain_water(heights: list[int]) -> int",
    "description": "Unit-width nonnegative bars; return total units of trapped rainwater.",
    "notes": "",
    "tags": [
      "two-pointers"
    ],
    "examples": [
      {
        "case_id": "PY100-H11-T01",
        "input": [
          [
            0,
            1,
            0,
            2,
            1,
            0,
            1,
            3,
            2,
            1,
            2,
            1
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-H11-T02",
        "input": [
          [
            4,
            2,
            0,
            3,
            2,
            5
          ]
        ],
        "expected": 9
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H11-T01",
        "input": [
          [
            0,
            1,
            0,
            2,
            1,
            0,
            1,
            3,
            2,
            1,
            2,
            1
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-H11-T02",
        "input": [
          [
            4,
            2,
            0,
            3,
            2,
            5
          ]
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-H11-T03",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H11-T04",
        "input": [
          [
            3,
            3,
            3
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H11-T05",
        "input": [
          [
            0,
            1,
            2,
            3
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H11-T06",
        "input": [
          [
            3,
            0,
            3
          ]
        ],
        "expected": 3
      }
    ]
  },
  {
    "id": "PY100-H12",
    "difficulty": "hard",
    "slug": "sliding_window_maximum",
    "function_name": "sliding_window_maximum",
    "signature": "sliding_window_maximum(nums: list[int], k: int) -> list[int]",
    "description": "Return maximum in every contiguous window of size k. nums nonempty, 1<=k<=len(nums).",
    "notes": "",
    "tags": [
      "deque"
    ],
    "examples": [
      {
        "case_id": "PY100-H12-T01",
        "input": [
          [
            1,
            3,
            -1,
            -3,
            5,
            3,
            6,
            7
          ],
          3
        ],
        "expected": [
          3,
          3,
          5,
          5,
          6,
          7
        ]
      },
      {
        "case_id": "PY100-H12-T02",
        "input": [
          [
            1
          ],
          1
        ],
        "expected": [
          1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H12-T01",
        "input": [
          [
            1,
            3,
            -1,
            -3,
            5,
            3,
            6,
            7
          ],
          3
        ],
        "expected": [
          3,
          3,
          5,
          5,
          6,
          7
        ]
      },
      {
        "case_id": "PY100-H12-T02",
        "input": [
          [
            1
          ],
          1
        ],
        "expected": [
          1
        ]
      },
      {
        "case_id": "PY100-H12-T03",
        "input": [
          [
            9,
            8,
            7
          ],
          1
        ],
        "expected": [
          9,
          8,
          7
        ]
      },
      {
        "case_id": "PY100-H12-T04",
        "input": [
          [
            2,
            2,
            2
          ],
          2
        ],
        "expected": [
          2,
          2
        ]
      },
      {
        "case_id": "PY100-H12-T05",
        "input": [
          [
            -1,
            -5,
            -3
          ],
          3
        ],
        "expected": [
          -1
        ]
      },
      {
        "case_id": "PY100-H12-T06",
        "input": [
          [
            4,
            1,
            7,
            2
          ],
          2
        ],
        "expected": [
          4,
          7,
          7
        ]
      }
    ]
  },
  {
    "id": "PY100-H13",
    "difficulty": "hard",
    "slug": "sliding_window_median",
    "function_name": "sliding_window_median",
    "signature": "sliding_window_median(nums: list[int], k: int) -> list[float]",
    "description": "Return median per contiguous size-k window. For even k use arithmetic mean of two middle numbers; results numerical.",
    "notes": "",
    "tags": [
      "heap",
      "sorting"
    ],
    "examples": [
      {
        "case_id": "PY100-H13-T01",
        "input": [
          [
            1,
            3,
            -1,
            -3,
            5,
            3,
            6,
            7
          ],
          3
        ],
        "expected": [
          1,
          -1,
          -1,
          3,
          5,
          6
        ]
      },
      {
        "case_id": "PY100-H13-T02",
        "input": [
          [
            1,
            2,
            3,
            4
          ],
          2
        ],
        "expected": [
          1.5,
          2.5,
          3.5
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H13-T01",
        "input": [
          [
            1,
            3,
            -1,
            -3,
            5,
            3,
            6,
            7
          ],
          3
        ],
        "expected": [
          1,
          -1,
          -1,
          3,
          5,
          6
        ]
      },
      {
        "case_id": "PY100-H13-T02",
        "input": [
          [
            1,
            2,
            3,
            4
          ],
          2
        ],
        "expected": [
          1.5,
          2.5,
          3.5
        ]
      },
      {
        "case_id": "PY100-H13-T03",
        "input": [
          [
            5
          ],
          1
        ],
        "expected": [
          5
        ]
      },
      {
        "case_id": "PY100-H13-T04",
        "input": [
          [
            0,
            0,
            0
          ],
          2
        ],
        "expected": [
          0.0,
          0.0
        ]
      },
      {
        "case_id": "PY100-H13-T05",
        "input": [
          [
            -2,
            -1,
            0,
            1
          ],
          4
        ],
        "expected": [
          -0.5
        ]
      },
      {
        "case_id": "PY100-H13-T06",
        "input": [
          [
            9,
            1,
            8,
            2,
            7
          ],
          3
        ],
        "expected": [
          8,
          2,
          7
        ]
      }
    ]
  },
  {
    "id": "PY100-H14",
    "difficulty": "hard",
    "slug": "kth_smallest_pair_distance",
    "function_name": "kth_smallest_pair_distance",
    "signature": "kth_smallest_pair_distance(nums: list[int], k: int) -> int",
    "description": "Among all unordered index pairs i<j, find kth smallest absolute difference counting duplicate distances; len>=2, valid k.",
    "notes": "",
    "tags": [
      "binary-search"
    ],
    "examples": [
      {
        "case_id": "PY100-H14-T01",
        "input": [
          [
            1,
            3,
            1
          ],
          1
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H14-T02",
        "input": [
          [
            1,
            6,
            1
          ],
          3
        ],
        "expected": 5
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H14-T01",
        "input": [
          [
            1,
            3,
            1
          ],
          1
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H14-T02",
        "input": [
          [
            1,
            6,
            1
          ],
          3
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-H14-T03",
        "input": [
          [
            1,
            2
          ],
          1
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H14-T04",
        "input": [
          [
            0,
            0,
            0
          ],
          2
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H14-T05",
        "input": [
          [
            -3,
            1,
            4
          ],
          2
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H14-T06",
        "input": [
          [
            1,
            2,
            3,
            4
          ],
          4
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-H15",
    "difficulty": "hard",
    "slug": "median_two_sorted",
    "function_name": "median_two_sorted",
    "signature": "median_two_sorted(a: list[int], b: list[int]) -> float",
    "description": "Both inputs sorted nondecreasing, combined length >=1. Return exact median, using arithmetic mean for even count.",
    "notes": "",
    "tags": [
      "binary-search"
    ],
    "examples": [
      {
        "case_id": "PY100-H15-T01",
        "input": [
          [
            1,
            3
          ],
          [
            2
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H15-T02",
        "input": [
          [
            1,
            2
          ],
          [
            3,
            4
          ]
        ],
        "expected": 2.5
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H15-T01",
        "input": [
          [
            1,
            3
          ],
          [
            2
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H15-T02",
        "input": [
          [
            1,
            2
          ],
          [
            3,
            4
          ]
        ],
        "expected": 2.5
      },
      {
        "case_id": "PY100-H15-T03",
        "input": [
          [],
          [
            1
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H15-T04",
        "input": [
          [
            0,
            0
          ],
          [
            0,
            0
          ]
        ],
        "expected": 0.0
      },
      {
        "case_id": "PY100-H15-T05",
        "input": [
          [
            -5,
            -1
          ],
          [
            -2,
            0
          ]
        ],
        "expected": -1.5
      },
      {
        "case_id": "PY100-H15-T06",
        "input": [
          [
            1
          ],
          [
            2,
            3,
            4
          ]
        ],
        "expected": 2.5
      }
    ]
  },
  {
    "id": "PY100-H16",
    "difficulty": "hard",
    "slug": "count_smaller_to_right",
    "function_name": "count_smaller_to_right",
    "signature": "count_smaller_to_right(nums: list[int]) -> list[int]",
    "description": "For each index, count strictly smaller elements to its right, retaining original positions.",
    "notes": "",
    "tags": [
      "fenwick",
      "divide-conquer"
    ],
    "examples": [
      {
        "case_id": "PY100-H16-T01",
        "input": [
          [
            5,
            2,
            6,
            1
          ]
        ],
        "expected": [
          2,
          1,
          1,
          0
        ]
      },
      {
        "case_id": "PY100-H16-T02",
        "input": [
          []
        ],
        "expected": []
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H16-T01",
        "input": [
          [
            5,
            2,
            6,
            1
          ]
        ],
        "expected": [
          2,
          1,
          1,
          0
        ]
      },
      {
        "case_id": "PY100-H16-T02",
        "input": [
          []
        ],
        "expected": []
      },
      {
        "case_id": "PY100-H16-T03",
        "input": [
          [
            1,
            1,
            1
          ]
        ],
        "expected": [
          0,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-H16-T04",
        "input": [
          [
            3,
            2,
            1
          ]
        ],
        "expected": [
          2,
          1,
          0
        ]
      },
      {
        "case_id": "PY100-H16-T05",
        "input": [
          [
            -1,
            -2,
            -3
          ]
        ],
        "expected": [
          2,
          1,
          0
        ]
      },
      {
        "case_id": "PY100-H16-T06",
        "input": [
          [
            2,
            0,
            1
          ]
        ],
        "expected": [
          2,
          0,
          0
        ]
      }
    ]
  },
  {
    "id": "PY100-H17",
    "difficulty": "hard",
    "slug": "single_source_shortest_paths",
    "function_name": "single_source_shortest_paths",
    "signature": "single_source_shortest_paths(n: int, edges: list[list[int]], source: int) -> list[int]",
    "description": "Directed weighted edges [u,v,w] with nonnegative integer weights; shortest path from source to each node, -1 if unreachable.",
    "notes": "",
    "tags": [
      "graphs",
      "dijkstra"
    ],
    "examples": [
      {
        "case_id": "PY100-H17-T01",
        "input": [
          5,
          [
            [
              0,
              1,
              2
            ],
            [
              1,
              2,
              3
            ],
            [
              0,
              3,
              1
            ],
            [
              3,
              2,
              1
            ]
          ],
          0
        ],
        "expected": [
          0,
          2,
          2,
          1,
          -1
        ]
      },
      {
        "case_id": "PY100-H17-T02",
        "input": [
          3,
          [],
          0
        ],
        "expected": [
          0,
          -1,
          -1
        ]
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H17-T01",
        "input": [
          5,
          [
            [
              0,
              1,
              2
            ],
            [
              1,
              2,
              3
            ],
            [
              0,
              3,
              1
            ],
            [
              3,
              2,
              1
            ]
          ],
          0
        ],
        "expected": [
          0,
          2,
          2,
          1,
          -1
        ]
      },
      {
        "case_id": "PY100-H17-T02",
        "input": [
          3,
          [],
          0
        ],
        "expected": [
          0,
          -1,
          -1
        ]
      },
      {
        "case_id": "PY100-H17-T03",
        "input": [
          1,
          [],
          0
        ],
        "expected": [
          0
        ]
      },
      {
        "case_id": "PY100-H17-T04",
        "input": [
          3,
          [
            [
              0,
              1,
              0
            ],
            [
              1,
              2,
              0
            ]
          ],
          0
        ],
        "expected": [
          0,
          0,
          0
        ]
      },
      {
        "case_id": "PY100-H17-T05",
        "input": [
          4,
          [
            [
              0,
              1,
              10
            ],
            [
              0,
              2,
              1
            ],
            [
              2,
              1,
              2
            ]
          ],
          0
        ],
        "expected": [
          0,
          3,
          1,
          -1
        ]
      },
      {
        "case_id": "PY100-H17-T06",
        "input": [
          2,
          [
            [
              1,
              0,
              5
            ]
          ],
          1
        ],
        "expected": [
          5,
          0
        ]
      }
    ]
  },
  {
    "id": "PY100-H18",
    "difficulty": "hard",
    "slug": "flight_with_stops",
    "function_name": "flight_with_stops",
    "signature": "flight_with_stops(n: int, flights: list[list[int]], src: int, dst: int, max_stops: int) -> int",
    "description": "Directed flights [u,v,cost] with positive costs. Minimum fare from src to dst using at most max_stops intermediate cities (at most max_stops+1 edges), or -1.",
    "notes": "",
    "tags": [
      "graphs",
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-H18-T01",
        "input": [
          4,
          [
            [
              0,
              1,
              100
            ],
            [
              1,
              2,
              100
            ],
            [
              2,
              3,
              100
            ],
            [
              0,
              3,
              500
            ]
          ],
          0,
          3,
          1
        ],
        "expected": 500
      },
      {
        "case_id": "PY100-H18-T02",
        "input": [
          4,
          [
            [
              0,
              1,
              100
            ],
            [
              1,
              2,
              100
            ],
            [
              2,
              3,
              100
            ],
            [
              0,
              3,
              500
            ]
          ],
          0,
          3,
          2
        ],
        "expected": 300
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H18-T01",
        "input": [
          4,
          [
            [
              0,
              1,
              100
            ],
            [
              1,
              2,
              100
            ],
            [
              2,
              3,
              100
            ],
            [
              0,
              3,
              500
            ]
          ],
          0,
          3,
          1
        ],
        "expected": 500
      },
      {
        "case_id": "PY100-H18-T02",
        "input": [
          4,
          [
            [
              0,
              1,
              100
            ],
            [
              1,
              2,
              100
            ],
            [
              2,
              3,
              100
            ],
            [
              0,
              3,
              500
            ]
          ],
          0,
          3,
          2
        ],
        "expected": 300
      },
      {
        "case_id": "PY100-H18-T03",
        "input": [
          3,
          [
            [
              0,
              1,
              100
            ],
            [
              1,
              2,
              100
            ],
            [
              0,
              2,
              500
            ]
          ],
          0,
          2,
          0
        ],
        "expected": 500
      },
      {
        "case_id": "PY100-H18-T04",
        "input": [
          3,
          [],
          0,
          2,
          2
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-H18-T05",
        "input": [
          1,
          [],
          0,
          0,
          0
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H18-T06",
        "input": [
          3,
          [
            [
              0,
              1,
              1
            ],
            [
              1,
              0,
              1
            ],
            [
              1,
              2,
              1
            ]
          ],
          0,
          2,
          1
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-H19",
    "difficulty": "hard",
    "slug": "shortest_walk_visit_all",
    "function_name": "shortest_walk_visit_all",
    "signature": "shortest_walk_visit_all(n: int, edges: list[list[int]]) -> int",
    "description": "Undirected graph nodes 0..n-1, n<=10. Start anywhere; shortest walk visiting all nodes at least once, repeating allowed; -1 if disconnected.",
    "notes": "",
    "tags": [
      "graphs",
      "bitmask"
    ],
    "examples": [
      {
        "case_id": "PY100-H19-T01",
        "input": [
          4,
          [
            [
              0,
              1
            ],
            [
              0,
              2
            ],
            [
              0,
              3
            ]
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H19-T02",
        "input": [
          5,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ],
            [
              2,
              3
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": 4
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H19-T01",
        "input": [
          4,
          [
            [
              0,
              1
            ],
            [
              0,
              2
            ],
            [
              0,
              3
            ]
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H19-T02",
        "input": [
          5,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ],
            [
              2,
              3
            ],
            [
              3,
              4
            ]
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H19-T03",
        "input": [
          1,
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H19-T04",
        "input": [
          3,
          []
        ],
        "expected": -1
      },
      {
        "case_id": "PY100-H19-T05",
        "input": [
          4,
          [
            [
              0,
              1
            ],
            [
              1,
              2
            ],
            [
              2,
              3
            ],
            [
              3,
              0
            ]
          ]
        ],
        "expected": 3
      },
      {
        "case_id": "PY100-H19-T06",
        "input": [
          2,
          [
            [
              0,
              1
            ]
          ]
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-H20",
    "difficulty": "hard",
    "slug": "min_grid_path_sum",
    "function_name": "min_grid_path_sum",
    "signature": "min_grid_path_sum(grid: list[list[int]]) -> int",
    "description": "Nonempty rectangular nonnegative grid. Start top-left, move only right/down; minimum sum including endpoints.",
    "notes": "",
    "tags": [
      "dp",
      "grid"
    ],
    "examples": [
      {
        "case_id": "PY100-H20-T01",
        "input": [
          [
            [
              1,
              3,
              1
            ],
            [
              1,
              5,
              1
            ],
            [
              4,
              2,
              1
            ]
          ]
        ],
        "expected": 7
      },
      {
        "case_id": "PY100-H20-T02",
        "input": [
          [
            [
              1,
              2,
              3
            ],
            [
              4,
              5,
              6
            ]
          ]
        ],
        "expected": 12
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H20-T01",
        "input": [
          [
            [
              1,
              3,
              1
            ],
            [
              1,
              5,
              1
            ],
            [
              4,
              2,
              1
            ]
          ]
        ],
        "expected": 7
      },
      {
        "case_id": "PY100-H20-T02",
        "input": [
          [
            [
              1,
              2,
              3
            ],
            [
              4,
              5,
              6
            ]
          ]
        ],
        "expected": 12
      },
      {
        "case_id": "PY100-H20-T03",
        "input": [
          [
            [
              5
            ]
          ]
        ],
        "expected": 5
      },
      {
        "case_id": "PY100-H20-T04",
        "input": [
          [
            [
              0,
              0
            ],
            [
              0,
              0
            ]
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H20-T05",
        "input": [
          [
            [
              1,
              9,
              1
            ]
          ]
        ],
        "expected": 11
      },
      {
        "case_id": "PY100-H20-T06",
        "input": [
          [
            [
              2
            ],
            [
              3
            ],
            [
              4
            ]
          ]
        ],
        "expected": 9
      }
    ]
  },
  {
    "id": "PY100-H21",
    "difficulty": "hard",
    "slug": "unique_paths_obstacles",
    "function_name": "unique_paths_obstacles",
    "signature": "unique_paths_obstacles(grid: list[list[int]]) -> int",
    "description": "Rectangular grid 0 open, 1 blocked. Count paths top-left to bottom-right moving only right/down, avoiding blocked cells.",
    "notes": "",
    "tags": [
      "dp",
      "grid"
    ],
    "examples": [
      {
        "case_id": "PY100-H21-T01",
        "input": [
          [
            [
              0,
              0,
              0
            ],
            [
              0,
              1,
              0
            ],
            [
              0,
              0,
              0
            ]
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H21-T02",
        "input": [
          [
            [
              0,
              1
            ],
            [
              0,
              0
            ]
          ]
        ],
        "expected": 1
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H21-T01",
        "input": [
          [
            [
              0,
              0,
              0
            ],
            [
              0,
              1,
              0
            ],
            [
              0,
              0,
              0
            ]
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H21-T02",
        "input": [
          [
            [
              0,
              1
            ],
            [
              0,
              0
            ]
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H21-T03",
        "input": [
          [
            [
              1
            ]
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H21-T04",
        "input": [
          [
            [
              0
            ]
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H21-T05",
        "input": [
          [
            [
              0,
              0
            ],
            [
              0,
              0
            ]
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H21-T06",
        "input": [
          [
            [
              0,
              0
            ],
            [
              1,
              1
            ]
          ]
        ],
        "expected": 0
      }
    ]
  },
  {
    "id": "PY100-H22",
    "difficulty": "hard",
    "slug": "maximal_one_rectangle",
    "function_name": "maximal_one_rectangle",
    "signature": "maximal_one_rectangle(grid: list[str]) -> int",
    "description": "Rectangular rows of characters 0/1, find largest area rectangle consisting only of 1 cells.",
    "notes": "",
    "tags": [
      "stack",
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-H22-T01",
        "input": [
          [
            "10100",
            "10111",
            "11111",
            "10010"
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-H22-T02",
        "input": [
          [
            "0"
          ]
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H22-T01",
        "input": [
          [
            "10100",
            "10111",
            "11111",
            "10010"
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-H22-T02",
        "input": [
          [
            "0"
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H22-T03",
        "input": [
          [
            "1"
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H22-T04",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H22-T05",
        "input": [
          [
            "111",
            "111"
          ]
        ],
        "expected": 6
      },
      {
        "case_id": "PY100-H22-T06",
        "input": [
          [
            "101",
            "010",
            "101"
          ]
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-H23",
    "difficulty": "hard",
    "slug": "palindrome_partition_cuts",
    "function_name": "palindrome_partition_cuts",
    "signature": "palindrome_partition_cuts(text: str) -> int",
    "description": "Minimum cuts dividing string into nonempty palindromic substrings; empty text requires zero cuts.",
    "notes": "",
    "tags": [
      "dp",
      "strings"
    ],
    "examples": [
      {
        "case_id": "PY100-H23-T01",
        "input": [
          "aab"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H23-T02",
        "input": [
          "a"
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H23-T01",
        "input": [
          "aab"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H23-T02",
        "input": [
          "a"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H23-T03",
        "input": [
          "ab"
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H23-T04",
        "input": [
          ""
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H23-T05",
        "input": [
          "abba"
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H23-T06",
        "input": [
          "abcbaef"
        ],
        "expected": 2
      }
    ]
  },
  {
    "id": "PY100-H24",
    "difficulty": "hard",
    "slug": "maximal_one_square",
    "function_name": "maximal_one_square",
    "signature": "maximal_one_square(grid: list[str]) -> int",
    "description": "Rectangular binary character grid; area of largest all-1 square (0 if none).",
    "notes": "",
    "tags": [
      "dp",
      "matrix"
    ],
    "examples": [
      {
        "case_id": "PY100-H24-T01",
        "input": [
          [
            "10100",
            "10111",
            "11111",
            "10010"
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H24-T02",
        "input": [
          [
            "0"
          ]
        ],
        "expected": 0
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H24-T01",
        "input": [
          [
            "10100",
            "10111",
            "11111",
            "10010"
          ]
        ],
        "expected": 4
      },
      {
        "case_id": "PY100-H24-T02",
        "input": [
          [
            "0"
          ]
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H24-T03",
        "input": [
          [
            "1"
          ]
        ],
        "expected": 1
      },
      {
        "case_id": "PY100-H24-T04",
        "input": [
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H24-T05",
        "input": [
          [
            "111",
            "111",
            "111"
          ]
        ],
        "expected": 9
      },
      {
        "case_id": "PY100-H24-T06",
        "input": [
          [
            "101",
            "010",
            "101"
          ]
        ],
        "expected": 1
      }
    ]
  },
  {
    "id": "PY100-H25",
    "difficulty": "hard",
    "slug": "minimum_stick_cut_cost",
    "function_name": "minimum_stick_cut_cost",
    "signature": "minimum_stick_cut_cost(length: int, cuts: list[int]) -> int",
    "description": "Stick from 0 to length, distinct interior cut positions. Cost per cut is current segment length. Find minimum total cost.",
    "notes": "",
    "tags": [
      "dp"
    ],
    "examples": [
      {
        "case_id": "PY100-H25-T01",
        "input": [
          7,
          [
            1,
            3,
            4,
            5
          ]
        ],
        "expected": 16
      },
      {
        "case_id": "PY100-H25-T02",
        "input": [
          9,
          [
            5,
            6,
            1,
            4,
            2
          ]
        ],
        "expected": 22
      }
    ],
    "tests": [
      {
        "case_id": "PY100-H25-T01",
        "input": [
          7,
          [
            1,
            3,
            4,
            5
          ]
        ],
        "expected": 16
      },
      {
        "case_id": "PY100-H25-T02",
        "input": [
          9,
          [
            5,
            6,
            1,
            4,
            2
          ]
        ],
        "expected": 22
      },
      {
        "case_id": "PY100-H25-T03",
        "input": [
          10,
          []
        ],
        "expected": 0
      },
      {
        "case_id": "PY100-H25-T04",
        "input": [
          2,
          [
            1
          ]
        ],
        "expected": 2
      },
      {
        "case_id": "PY100-H25-T05",
        "input": [
          100,
          [
            50
          ]
        ],
        "expected": 100
      },
      {
        "case_id": "PY100-H25-T06",
        "input": [
          6,
          [
            2,
            4
          ]
        ],
        "expected": 10
      }
    ]
  }
]