LEARNBAY On-Campus OA (2025) | Problem Merge Strings Alternately

Question · Posted Jun 2026

Problem Statement You are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If one string is longer than the other, append the additional letters to the end of the merged string. Return the merged string. Example Input word1 = "abc" word2 = "pqr" Output "apbqcr" Explanation Take 'a' from word1 Take 'p' from word2 Take 'b' from word1 Take 'q' from word2 Take 'c' from word1 Take 'r' from word2 ...

The full answer & interview discussion are available to premium members.

Log in Create a free account