본문 바로가기

항해99_코테스터디

[항해99]99클럽 코테 스터디 22일차 TIL + 문자열

 

 

1.  오늘의 학습 키워드 : 문자열

문자열입니다!! 

 

.charAt(n) : 문자열의 n번째를 리턴

2.  오늘의 문제 Shuffle String

https://leetcode.com/problems/shuffle-string/

 

3.  풀이 

class Solution {
    public String restoreString(String s, int[] indices) {
        int n = indices.length;
        char[] result = new char[n];
        
        for (int i = 0; i < n; i++) {
            result[indices[i]] = s.charAt(i);
        }
        
        return new String(result);
    }
}

 

3.  회고 

비기너 문제는 쉽게 풀리지만 코테를 풀었을 때는 문제가 잘 풀리지 않아 이젠 미들러와 챌린저도 함께 도전해야겠습니다.