ㅁ 틀린 풀이
class Solution {
public String solution(String my_string, String letter) {
return my_string.replace("letter", "");
}
}
- letter를 따옴표를 감싸면 진짜로 "letter"라는 문자열을 교체함. 따옴표를 떼야 한다.
ㅁ 내 풀이
class Solution {
public String solution(String my_string, String letter) {
return my_string.replace(letter, "");
}
}
'코딩테스트 > 프로그래머스 Lv.0' 카테고리의 다른 글
[코테/0레벨] 자릿수 더하기 (0) | 2025.02.11 |
---|---|
[코테/0레벨] 문자열 뒤집기 (0) | 2025.02.07 |
[코테/0레벨] 세균 증식 (0) | 2025.02.03 |
[코테/0레벨] 편지 (0) | 2025.02.03 |
[코테/0레벨] 최댓값 만들기 (1) (0) | 2025.02.03 |