class Solution {
public:
string mergeAlternately(string word1, string word2) {
string answer = "";
int index1 = 0;
int index2 = 0;
while(index1 < word1.length() && index2 < word2.length()){
answer += word1[index1++];
answer += word2[index2++];
}
while(index1 < word1.length()) answer += word1[index1++];
while(index2 < word2.length()) answer += word2[index2++];
return answer;
}
};