Java
[알고리즘/Java] String(문자열) - 단어 뒤집기
방법 1. Stringbuilder(string).reverse() import java.util.ArrayList; import java.util.Scanner; public class Main { public ArrayList solution(int n, String[] str){ ArrayList answer = new ArrayList(); for (String x : str) { String tmp = new StringBuilder(x).reverse().toString(); answer.add(tmp); } return answer; } public static void main(String[] args) { Main T = new Main(); Scanner kb = new Scanner(..
2022. 7. 24. 12:18