https://leetcode.com/problems/find-the-peaks/description/
1 2 3 4 5 6 7 8 9 | class Solution: def findPeaks(self, mountain: List[int]) -> List[int]: answer = [] for i in range(1, len(mountain) - 1): if mountain[i-1]< mountain[i] and mountain[i] > mountain[i+1]: answer.append(i) return answer | cs |
반응형
'python-algorithm' 카테고리의 다른 글
leetcode 2928. Distribute Candies Among Children I (0) | 2023.12.27 |
---|---|
leetcode CodeTestcaseTestcaseTest Result2942. Find Words Containing Character (0) | 2023.12.27 |
leetcode 2956. Find Common Elements Between Two Arrays (0) | 2023.12.27 |
leetcode 2965. Find Missing and Repeated Values (0) | 2023.12.27 |
백준 4388 받아올림 (0) | 2023.12.27 |
댓글