feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -8,6 +8,30 @@ categories:
patterns:
- greedy
function_signature: "def break_palindrome(palindrome: str) -> str:"
test_cases:
visible:
- input: { palindrome: "abccba" }
expected: "aaccba"
- input: { palindrome: "a" }
expected: ""
hidden:
- input: { palindrome: "aa" }
expected: "ab"
- input: { palindrome: "aba" }
expected: "abb"
- input: { palindrome: "aaa" }
expected: "aab"
- input: { palindrome: "aaaa" }
expected: "aaab"
- input: { palindrome: "bab" }
expected: "aab"
- input: { palindrome: "abba" }
expected: "aaba"
- input: { palindrome: "zyzyz" }
expected: "ayzyz"
description: |
Given a palindromic string of lowercase English letters `palindrome`, replace **exactly one** character with any lowercase English letter so that the resulting string is **not** a palindrome and that it is the **lexicographically smallest** one possible.