목록Queue (2)
취미가 좋다
https://leetcode.com/problems/sliding-window-maximum/submissions/ Sliding Window Maximum - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Solution import heapq from collections import defaultdict class Solution: def maxSlidingWindow(self, nums, k): ans = [max(nums[:k])] pq = [] ou..
https://leetcode.com/problems/course-schedule/ Course Schedule - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Solution from queue import Queue class Solution: def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool: q = Queue() a2b = {} # a : 조건이 필요한 수업 b2a ..