feat(content): function signatures + test cases
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user