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
- Class
- two pointers
- array
- Math
- database
- 코테
- implement
- Binary Tree
- dynamic programming
- simulation
- 자바
- Data Structure
- Binary Search
- Stack
- 구현
- bit manipulation
- string
- Counting
- Matrix
- SQL
- java
- sorting
- geometry
- Method
- greedy
- 파이썬
- 코딩테스트
- Tree
- hash table
- Number Theory
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 문자열의 앞의 n글자 본문
1. Input
1) String my_string
2) int n
2. Output
1) my_string의 앞의 n글자로 이루어진 문자열을 반환
3. Constraint
1) my_string은 숫자와 알파벳으로 이루어져 있다.
2) 1 ≤ my_string의 길이 ≤ 1,000
3) 1 ≤ n ≤ my_string의 길이
4. Example
Input: my_string="ProgrammerS123", n=11 -> Output: "ProgrammerS"
5. Code
1) 첫 코드(2023/04/22)
return my_string.substring(0,n);
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 대문자로 바꾸기 (0) | 2023.04.22 |
---|---|
[프로그래머스/Lv.0] 문자열 곱하기 (0) | 2023.04.22 |
[프로그래머스/Lv.0] 문자열로 변환 (0) | 2023.04.22 |
[프로그래머스/Lv.0] 공배수 (0) | 2023.04.22 |
[프로그래머스/Lv.0] 문자열을 정수로 변환하기 (0) | 2023.04.22 |