class Solution { public String[] solution(String[] strArr) { String[] answer = new String [strArr.length]; for(int i = 0; i < strArr.length; i++) { if(i % 2 == 0 || i == 0) { answer[i] = strArr[i].replace(strArr[i] ,strArr[i].toLowerCase()); } else { answer[i] = strArr[i].replace(strArr[i], strArr[i].toUpperCase()); } } return answer; } }
class Solution { public int solution(String num_str) { int answer = 0; for(int i = 0; i < num_str.length(); i++) { answer += Integer.parseInt(num_str.substring(i, i+1)); } return answer; } }
class Solution { public int solution(int[] arr1, int[] arr2) { int answer = 0; if(arr1.length != arr2.length) { answer = (arr1.length > arr2.length) ? 1 : -1; } else { int num1 = 0; int num2 = 0; for(int i = 0; i num2) ? 1 : (num1 < num2) ? -1 : 0; } } return answer; } }
class Solution { public String solution(String my_string, int[] index_list) { String answer = ""; for(int i = 0; i < index_list.length; i++) { answer += my_string.substring(index_list[i], index_list[i]+1); } return answer; } }
class Solution { public String solution(String cipher, int code) { String answer = ""; for(int i = 0; i < cipher.length(); i++) { if((i + 1) % code == 0) { answer += cipher.substring(i, i + 1); } } return answer; } }