134. 세로 읽기

김해준's avatar
Dec 26, 2025
134. 세로 읽기

사용언어 : Java

문제
notion image
풀이
/* m = 4 / c = 2 ihrhbakrfpndopljhygc ihrh bakr fpnd oplj hygc h a p p y 시작지점은 c번째 인덱스에서 부터 시작하고 m칸씩 건너뛰어서 읽으면 되지않을까 */ class Solution { public String solution(String my_string, int m, int c) { String answer = ""; for(int i = c - 1 ; i < my_string.length(); i+=m) { answer += my_string.charAt(i); } return answer; } }
notion image
Share article