LeetCode/Top Interview 150 106

BST: 153. Find Minimum in Rotated Sorted Array ★

153. Find Minimum in Rotated Sorted Array class Solution: def findMin(self, nums: List[int]) -> int: """ 회전된 정렬 배열에서 최소값을 찾는 함수. 배열은 오름차순으로 정렬된 상태에서 몇 번 회전된 상태일 수 있다. 예: [4, 5, 6, 7, 0, 1, 2] Find the minimum value in a rotated sorted array. The array was originally sorted in ascending order but may have been rotated. Example: [4, 5, 6, 7, 0, 1..

918. Maximum Sum Circular Subarray

918. Maximum Sum Circular Subarray 내 코드class Solution: def maxSubarraySumCircular(self, nums: List[int]) -> int: maxSum = nums[0] curSum = 0 for n in range(len(nums)*2): if curSum  이 코드는 틀렸음. %  모듈러 연산으로 회전 행렬을 반영하고 있으나.행렬 길이를 고려하고 있지 않음. class Solution: def maxSubarraySumCircular(self, nums: List[int]) -> int: maxSum = nums[0] curSum =..