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
- Tree
- 구현
- Counting
- Number Theory
- Class
- 코테
- SQL
- java
- Binary Tree
- array
- two pointers
- simulation
- bit manipulation
- greedy
- Data Structure
- 파이썬
- hash table
- 코딩테스트
- Method
- Stack
- geometry
- Math
- Matrix
- Binary Search
- database
- string
- 자바
- sorting
- implement
- dynamic programming
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 문자열안에 문자열 본문
1. Input
1) 문자열 str1
2) 문자열 str2
2. Output
1) str1 안에 str2가 있다면 1을, 없다면 2를 반환
3. Constraint
1) 1 ≤ str1의 길이 ≤ 100
2) 1 ≤ str2의 길이 ≤ 100
4. Example
Input: str1=“abcdefg”, str2=“de” -> Output: 1
Input: str1=“abcdefg”, str2=“gh” -> Output: 2
5. Code
1) 첫 코드(2022/10/25)
return str1.contains(str2) ? 1 : 2 ;
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 세균 증식 (0) | 2022.11.01 |
---|---|
[프로그래머스/Lv.0] 제곱수 판별하기 (0) | 2022.11.01 |
[프로그래머스/Lv.0] OX퀴즈 (0) | 2022.11.01 |
[프로그래머스/Lv.0] 자릿수 더하기 (0) | 2022.11.01 |
[프로그래머스/Lv.0] n의 배수 고르기 (0) | 2022.11.01 |