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
- C++
- 코드품앗이
- 파이썬
- 동적계획법과최단거리역추적
- DFS
- 백준
- 코딩테스트
- django
- android
- cos pro 1급
- Algorithm
- DFS와BFS
- 코테
- Flutter
- 분할정복
- 개발
- Python
- cos pro
- 동적계획법
- 알고리즘
- 안드로이드
- 안드로이드스튜디오
- AndroidStudio
- BAEKJOON
- DART
- issue
- Vue
- codingtest
- vuejs
- cos
Archives
- Today
- Total
목록cos 1급 2차 언제까지 오르막길이야 python (1)
Development Artist

문제 유형 코딩 난이도 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