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