Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | |||||
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 |
Tags
- 문제해결
- greedy
- binary search
- dfs
- COS PRO
- 문자열
- Java
- 코딩테스트
- 이분탐색
- 건강
- priorityqueue
- BOJ
- oracle
- math
- 시뮬레이션
- 투포인터
- DP
- 문제풀이
- SWEA
- 알고리즘
- 러닝일지
- SQL
- 백준
- BFS
- 운동기록
- 자바
- db
- MySQL
- 프로그래머스
- 코테
Archives
- Today
- Total
슈콩
[프로그래머스] 문자열 안에 문자 본문
class Solution {
public int solution(String str1, String str2) {
int answer = str1.length();
str1 = str1.replaceAll(str2,"");
if(answer != str1.length()){
answer = 1;
}
else answer = 2;
return answer;
}
}'Algorithms > Programmers' 카테고리의 다른 글
| [프로그래머스] 특정 문자 제거하기 (0) | 2025.10.12 |
|---|---|
| [프로그래머스] 문자 반복 출력하기 (0) | 2025.10.12 |
| [프로그래머스] Lv.1 문자열 나누기 (0) | 2025.10.11 |
| [프로그래머스] Lv.1 문자열 내 마음대로 정렬하기 (0) | 2025.10.11 |
| [프로그래머스] Lv.1 크기가 작은 부분 문자열 (0) | 2025.10.11 |