class Solution {
public String solution(String str1, String str2) {
String answer = "";
return answer;
}
}
class Solution {
public String solution(String str1, String str2) {
String answer = "";
for (int i = 0; i < str1.length(); i++) {
answer += str1.substring(i, i+1);
answer += str2.substring(i, i+1);
}
return answer;
}
}
str1.length()
answer += str1.substring(i, i+1) + str2.substring(i, i+1); 으로 합쳐도 무방.
class Solution {
public String solution(String str1, String str2) {
String answer = "";
String[] str1Arr = str1.split("");
String[] str2Arr = str2.split("");
for (int i = 0; i < str1Arr.length; i++) {
answer += str1Arr[i] + str2Arr[i];
}
return answer;
}
}