[프로그래머스/Java] Lv.0 잘라서 배열로 저장하기
문제 풀이 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class Solution { public String[] solution(String my_str, int n) { int length=(int) Math.ceil((double)my_str.length()/n); //my_str을 n으로 나누고 올림해서 int에 저장함 String[] answer=new String[length]; //길이가 length인 answer배열 int index=0; for(int i=0; i