https://school.programmers.co.kr/learn/courses/30/lessons/12906
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
def solution(arr):
answer = [arr[0]]
for i in range(1, len(arr)):
if arr[i] != answer[-1]:
answer.append(arr[i])
return answer
It wasn’t easy... Sometimes the basics are the hardest to figure out. I solved it back in February, but it was so tough. Let’s stick to the basics!
'알고리즘 > Programmers' 카테고리의 다른 글
[프로그래머스] 2021 Dev-Matching: 웹 백엔드 개발자(상반기) | 로또의 최고 순위와 최저 순위(python) (0) | 2024.12.05 |
---|---|
[프로그래머스] 2018 KAKAO BLIND RECRUITMENT[1차] | 비밀지도 (python) (0) | 2024.12.04 |
[프로그래머스] [PCCP 기출문제] 1번 / 동영상 재생기 (python) (0) | 2024.12.04 |
[프로그래머스] 내적 (python) (0) | 2024.12.04 |
[프로그래머스] Lv2. 다리를 지나는 트럭 (0) | 2024.02.29 |