https://school.programmers.co.kr/learn/courses/30/lessons/12910
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr
1. 내가 작성한 코드
def solution(arr, divisor):
answer = []
for i in arr:
if i % divisor == 0:
answer.append(i)
if len(answer) == 0:
return [-1]
else:
return sorted(answer)
'🔅코딩테스트 공부🔅 > ❗프로그래머스(Lv.1)' 카테고리의 다른 글
[프로그래머스] Level1 같은 숫자는 싫어(with python) (0) | 2023.01.29 |
---|---|
[프로그래머스] Level1 두 정수 사이의 합(with python) (0) | 2023.01.29 |
[프로그래머스] Level1 가운데 글자 가져오기(with python) (0) | 2023.01.29 |
[프로그래머스] Level1 2016(with python) (1) | 2023.01.29 |
[프로그래머스] Level1 폰켓몬(with python) (0) | 2023.01.29 |
댓글