leetcode - contest3 weekly-contest-323 개요 날짜 2022.12.11 일 11:30 ~ 13:00 링크: https://leetcode.com/contest/weekly-contest-323/ 결과 3 / 4 1. Delete Greatest Value in Each Row 링크: https://leetcode.com/contest/weekly-contest-323/problems/delete-greatest-value-in-each-row/ 반복문 사용 class Solution: def deleteGreatestValue(self, grid: List[List[int]]) -> int: # 1. init n = len(grid) m = len(grid[0]) res = 0 # 2. sort for i in range(n): grid[i.. 2022. 12. 11. weekly-contest-322 개요 날짜 2022.12.04 일 11:30 ~ 13:00 링크: https://leetcode.com/contest/weekly-contest-322/ 결과 3 / 4 1. Circular Sentence 링크: https://leetcode.com/contest/weekly-contest-322/problems/circular-sentence/ 반복문 사용 class Solution: def isCircularSentence(self, sentence: str) -> bool: # 1. init s = sentence.split(" ") # 2. loop prev = s[-1] for c in s: if prev[-1] != c[0]: return False prev = c return T.. 2022. 12. 4. weekly-contest-321 개요 날짜 2022.11.27 일 11:30 ~ 13:00 링크: https://leetcode.com/contest/weekly-contest-321/ 결과 3 / 4 1. Find the Pivot Integer 링크: https://leetcode.com/contest/weekly-contest-321/problems/find-the-pivot-integer/ 누적합 사용 class Solution: def pivotInteger(self, n: int) -> int: d = [0] * (n+1) for i in range(1, n+1): d[i] = d[i-1] + i res = -1 for i in range(1, n+1): front = d[i] back = d[n] - d[i] +.. 2022. 12. 4. 이전 1 다음