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 | 29 | 30 |
Tags
- android
- C++
- issue
- DART
- 안드로이드
- 분할정복
- 파이썬
- 코테
- 백준
- DFS와BFS
- docker
- 코드품앗이
- vuejs
- Python
- 개발
- django
- cos pro
- cos
- cos pro 1급
- AndroidStudio
- codingtest
- BAEKJOON
- 동적계획법과최단거리역추적
- 안드로이드스튜디오
- Flutter
- 동적계획법
- 코딩테스트
- 알고리즘
- DFS
- Algorithm
Archives
- Today
- Total
목록cos 1급 2차 5번 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