Merge Strings Alternately

给两个string, 返回一个string, 要求交替字符.

class Solution {
    public String mergeAlternately(String word1, String word2) { 
        int n = word1.length();
        int m = word2.length();
        StringBuilder sb = new StringBuilder();
        int i = 0;
        for(; i < Math.min(n, m); i++){
            sb.append(word1.charAt(i));
            sb.append(word2.charAt(i));
        }
        while(i < n) {
            sb.append(word1.charAt(i++));
        }
        while(i < m) {
            sb.append(word2.charAt(i++));
        }
        return sb.toString();
    }
}