Notice
Recent Posts
Recent Comments
Link
250x250
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 파이썬
- cos
- Flutter
- android
- 코테
- BAEKJOON
- 코드품앗이
- Algorithm
- 동적계획법과최단거리역추적
- codingtest
- vuejs
- 동적계획법
- django
- Python
- cos pro 1급
- Vue
- C++
- 안드로이드
- 알고리즘
- DFS와BFS
- 백준
- 코딩테스트
- AndroidStudio
- 개발
- DART
- DFS
- 분할정복
- cos pro
- 안드로이드스튜디오
- issue
Archives
- Today
- Total
목록cos 1급 2차 언제까지 오르막길이야 python (1)
Development Artist
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/dvxo4t/btruajdJlWt/ieh83PUjhS5OpNFiiT65v0/img.png)
문제 유형 코딩 난이도 normal Note 1. 오르막길 횟수를 count하는 배열 놓기. (내리막길을 카운트할 필요는 없음) 2. 해당 배열의 max값을 찾기 Code # -*- coding: utf-8 -*- # UTF-8 encoding when using korean # 2차 5번 def solution(arr): answer = 0 idx = 0 tmp = [0 for i in range(len(arr)-1)] for i in range(len(arr)-1): if arr[i] < arr[i+1]: tmp[idx] += 1 else: idx += 1 answer = max(tmp)+1 if answer < 2: return 1 return answer arr = [3, 1, 2, 4, 5, 1..
Algorithm/COS
2022. 2. 25. 10:18