feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent e28da5def2
commit 0f264ef603
94 changed files with 1840 additions and 0 deletions

View File

@@ -11,6 +11,28 @@ patterns:
- backtracking
- dynamic-programming
function_signature: "def partition(s: str) -> list[list[str]]:"
test_cases:
visible:
- input: { s: "aab" }
expected: [["a", "a", "b"], ["aa", "b"]]
- input: { s: "a" }
expected: [["a"]]
hidden:
- input: { s: "aa" }
expected: [["a", "a"], ["aa"]]
- input: { s: "abc" }
expected: [["a", "b", "c"]]
- input: { s: "aba" }
expected: [["a", "b", "a"], ["aba"]]
- input: { s: "aabb" }
expected: [["a", "a", "b", "b"], ["a", "a", "bb"], ["aa", "b", "b"], ["aa", "bb"]]
- input: { s: "abba" }
expected: [["a", "b", "b", "a"], ["a", "bb", "a"], ["abba"]]
- input: { s: "racecar" }
expected: [["r", "a", "c", "e", "c", "a", "r"], ["r", "a", "cec", "a", "r"], ["r", "aceca", "r"], ["racecar"]]
description: |
Given a string `s`, partition `s` such that every substring of the partition is a **palindrome**.