class Solution { public String solution(String my_string) { String answer = ""; for(int i = my_string.length() - 1; i >= 0; i--) { answer += my_string.charAt(i); } return answer; } }
class Solution { public int solution(int[] array, int height) { int answer = 0; for(int i = 0; i height) { answer ++; } } return answer; } }
class Solution { public String solution(String my_string, String letter) { String answer = ""; for(int i = 0; i < my_string.length(); i++) { if(my_string.charAt(i) == letter.charAt(0)) { } else { answer += my_string.charAt(i); } } return answer; } } 뭔가 간단하게 쓸 수 있는 방법이 있을 것 같아서 찾아보았더니 replaceAll method를 쓰면 간결하게 끝낼 수 있었다. class Solution { public String solution(String my_string, String letter) { S..
class Solution { public int[] solution(int[] num_list) { int[] answer = new int [num_list.length]; int j = 0; for (int i = num_list.length-1; i >= 0; i--) { answer[j] = num_list[i]; j++; } return answer; } }
class Solution { public int solution(int n, int k) { int answer = 0; if ( n / 10 > 0) { int service = n / 10; answer = (n * 12000) + ((k-service) * 2000); } else { answer = (n * 12000) + (k * 2000); } return answer; } }