feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,26 @@ categories:
|
||||
patterns:
|
||||
- two-pointers
|
||||
|
||||
function_signature: "def merge_alternately(word1: str, word2: str) -> str:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { word1: "abc", word2: "pqr" }
|
||||
expected: "apbqcr"
|
||||
- input: { word1: "ab", word2: "pqrs" }
|
||||
expected: "apbqrs"
|
||||
- input: { word1: "abcd", word2: "pq" }
|
||||
expected: "apbqcd"
|
||||
hidden:
|
||||
- input: { word1: "a", word2: "b" }
|
||||
expected: "ab"
|
||||
- input: { word1: "a", word2: "xyz" }
|
||||
expected: "axyz"
|
||||
- input: { word1: "xyz", word2: "a" }
|
||||
expected: "xayz"
|
||||
- input: { word1: "hello", word2: "world" }
|
||||
expected: "hweolrllod"
|
||||
|
||||
description: |
|
||||
You are given two strings `word1` and `word2`. Merge the strings by adding letters in alternating order, starting with `word1`. If a string is longer than the other, append the additional letters onto the end of the merged string.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user