Level1) 나누어 떨어지는 숫자 배열
import java.util.ArrayList; import java.util.Arrays; class Solution { public int[] solution(int[] arr, int divisor) { ArrayList list = new ArrayList(); for (int i = 0; i < arr.length; i++) { if (arr[i] % divisor == 0) { list.add(arr[i]); } } if (list.size() == 0) { list.add(-1); } int[] answer = new int[list.size()]; for (int i = 0; i < list.size(); i++) { answer[i] = list.get(i); } Arrays.sort(..
PS/programmers
2020. 9. 8. 15:35
링크
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- JPA 연관관계 매핑
- 김영한 http
- 드림코딩
- REST API
- BOJ
- js promise
- 킹수빈닷컴
- 이펙티브자바 스터디
- ㅇㄷㅇㅈ
- 이펙티브자바
- GCP
- 가상 면접 사례로 배우는 대규모 시스템 설계 기초
- 백기선 스터디
- 이펙티브자바 아이템59
- 김영한 JPA
- 프로그래머스 SQL
- java
- 모던자바스크립트
- HTTP 완벽가이드
- js api
- js array
- Spring Security
- http
- 백준
- 패스트캠퍼스 컴퓨터공학 완주반
- HTTP 완벽 가이드
- JS 딥다이브
- 프로그래머스
- dreamcoding
- 이펙티브자바 아이템60
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함