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

class Solution: def maximumUnits(self, boxTypes: List[List[int]], truckSize: int) -> int: # Sort boxTypes by units per box in descending order boxTypes.sort(key=lambda x: x[1], reverse=True) total_units = 0 for boxes, units_per_box in boxTypes: if truckSize == 0: break # Take as many boxes as possible, up to the truckSiz..

class Solution: def maximum69Number (self, num: int) -> int: num_str = list(str(num)) for i in range(len(num_str)): if num_str[i] == '6': num_str[i] = '9' break # Only change the single element return int(''.join(num_str))

class Solution: def largestPerimeter(self, nums: List[int]) -> int: nums.sort(reverse=True) # Sort descending for greedy check for i in range(len(nums)-2): a, b, c = nums[i], nums[i+1], nums[i+2] if b + c > a: # Triangle inequality return a + b + c return 0 for i in range(len(nums) - 2):is used because we are checking triplets of side ..