Two Pointers
1768. Merge Strings Alternately
Merge two strings by alternating characters (word1[0], word2[0], word1[1], …); append the remainder of the longer string. One index loop with bounds checks handles both the alternation and the…
Loading…
Merge two strings by alternating characters (word1[0], word2[0], word1[1], …); append the remainder of the longer string. One index loop with bounds checks handles both the alternation and the…
Loading…