feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

@@ -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.