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 |
Tags
- spring batch 5.0
- 단기개발자코스
- 프로그래머스
- infcon 2024
- 개발자부트캠프추천
- 프로그래머스 이중우선순위큐
- 항해99
- 디자인패턴
- 디자인 패턴
- 파이썬
- 1주일회고
- 전략패턴 #StrategyPattern #디자인패턴
- jwt
- 개발자 취업
- KPT회고
- 취업리부트코스
- jwttoken
- DesignPattern
- 빈 충돌
- @FeignClient
- Spring multimodule
- TiL
- 코딩테스트 준비
- 인프콘 2024
- 99클럽
- 커스텀 헤더
- 빈 조회 2개 이상
- JavaScript
- Python
- 구글 OAuth login
Archives
- Today
- Total
m1ndy5's coding blog
프로그래머스 같은 숫자는 싫어 with Python 본문
https://school.programmers.co.kr/learn/courses/30/lessons/12906
앞에서부터 훑어나가면서 다른 숫자가 들어올 때마다 넣어주면 된다!
def solution(arr):
answer = [arr[0]]
for i in range(1, len(arr)):
if arr[i] != answer[-1]:
answer.append(arr[i])
return answer
'알고리즘 with python > 20240909' 카테고리의 다른 글
프로그래머스 입국심사 with Python (0) | 2024.10.10 |
---|---|
프로그래머스 최소직사각형 with Python (1) | 2024.09.13 |
프로그래머스 K번째수 with Python (0) | 2024.09.12 |
프로그래머스 완주하지 못한 선수 with Python (0) | 2024.09.10 |
프로그래머스 폰켓몬 with Python (0) | 2024.09.09 |