일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 자연어처리
- slidingwindow
- medium
- gcp
- 알고리즘
- Python
- LeetCode
- 파이썬알고리즘
- dfs
- Python3
- GenAI
- nlp
- 슬라이딩윈도우
- GenerativeAI
- 투포인터
- Microsoft
- 코드업
- two-pointer
- heap
- 니트코드
- 생성형AI
- 리트코드
- 파이썬기초100제
- stratascratch
- 구글퀵랩
- 파이썬
- sql코테
- SQL
- 릿코드
- codeup
- Today
- Total
목록2025/04/07 (2)
Tech for good

class Solution: def frequencySort(self, s: str) -> str: # Step 1: Count frequency of each character freq = Counter(s) # Step 2: Build max-heap based on frequency # Use -count to simulate max-heap heap = [(-count, char) for char, count in freq.items()] heapq.heapify(heap) # Step 3: Build the result string from the heap result = []..

class Solution: def getFinalState(self, nums: List[int], k: int, multiplier: int) -> List[int]: n = len(nums) # Build a heap of (value, index) for index tracking heap = [(nums[i], i) for i in range(n)] heapq.heapify(heap) for _ in range(k): while True: val, idx = heapq.heappop(heap) # Check if the heap value m..