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
- simulation
- array
- greedy
- 파이썬
- 구현
- string
- Stack
- Tree
- Method
- hash table
- Binary Tree
- Matrix
- implement
- database
- Class
- Data Structure
- dynamic programming
- Counting
- geometry
- Binary Search
- two pointers
- java
- Math
- 코딩테스트
- 자바
- SQL
- bit manipulation
- Number Theory
- sorting
- 코테
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 중복된 숫자 개수 본문
1. Input
1) 정수 배열 array
2) 정수 n
2. Output
1) array에 담긴 n의 개수
3. Constraint
1) 1 <= array의 길이 <= 100
2) 0 <= array의 원소 <= 1,000
3) 0 <= n <= 1,000
4. Example
Input: array={1,1,2,3,4,5}, n=1 -> Output: 2
5. Code
1) 첫 코드(2022/10/17)
int answer = 0;
for(int i=0 ; i<array.length ; i++)
if(array[i]==n)
answer++;
return answer;
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 직사각형 넓이 구하기 (0) | 2022.11.02 |
---|---|
[프로그래머스/Lv.0] 머쓱이보다 키 큰 사람 (0) | 2022.11.02 |
[프로그래머스/Lv.0] 잘라서 배열로 저장하기 (0) | 2022.11.02 |
[프로그래머스/Lv.0] 7의 개수 (0) | 2022.11.02 |
[프로그래머스/Lv.0] 문자열 정렬하기 (2) (0) | 2022.11.01 |