class Solution { public String solution(String myString) { String answer = myString.replaceAll("[^l-z]", "l"); return answer; } }
class Solution { public int solution(int[][] arr) { int answer = 1; for(int i = 0; i < arr.length; i++) { for(int j = 0; j < arr.length; j++) { if(arr[i][j] == arr[j][i]) { answer *= 1; } else { answer *= 0; } } } return answer; } }
class Solution { public int solution(String myString, String pat) { int answer = 0; String str = ""; for(int i = 0; i < myString.length(); i++) { if(myString.substring(i,(i+1)).equals("A")) { str += "B"; } else if (myString.substring(i,(i+1)).equals("B")) { str += "A"; } } if(str.contains(pat)) { answer = 1; } return answer; } }
class Solution { public int solution(int[] box, int n) { int answer = 1; for(int i = 0; i < box.length; i++) { answer *= box[i] / n; } return answer; } }
class Solution { public String[] solution(String[] strArr) { int cnt = 0; for(int i = 0; i < strArr.length; i++) { if(strArr[i].contains("ad")) { cnt++; } } String[] answer = new String [strArr.length - cnt]; int idx = 0; for(int i = 0; i < strArr.length; i++) { if(!strArr[i].contains("ad")) { answer[idx++] = strArr[i]; } } return answer; } }