728x90
https://school.programmers.co.kr/learn/courses/30/lessons/181900
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
메모리: 91.4 MB, 시간: 0.06 ms
사용 알고리즘: 구현
class Solution {
public String solution(String my_string, int[] indices) {
// 지울 인덱스
boolean[] delete = new boolean[my_string.length()];
for(int i : indices) delete[i] = true;
StringBuilder answer = new StringBuilder();
for(int i = 0; i < my_string.length(); i++)
if(!delete[i]) answer.append(my_string.charAt(i));
return answer.toString();
}
}728x90
'Problem Solving > Programmers' 카테고리의 다른 글
| [프로그래머스, 181898] 가까운 1 찾기 (java) (0) | 2025.02.07 |
|---|---|
| [프로그래머스, 181899] 카운트 다운 (java) (0) | 2025.02.07 |
| [프로그래머스, 120842] 2차원으로 만들기 (java) (0) | 2025.02.07 |
| [프로그래머스, 120888] 중복된 문자 제거 (java) (0) | 2025.02.07 |
| [프로그래머스, 181903] qr code (java) (0) | 2025.02.06 |