본문 바로가기

LeetCode340

leetcode 1732. Find the Highest Altitude https://leetcode.com/problems/find-the-highest-altitude/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 class Solution: def largestAltitude(self, gain: List[int]) -> int: answer = [0] for altitu.. 2024. 2. 15.
leetcode 2784. Check if Array is Good https://leetcode.com/problems/check-if-array-is-good/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 10 11 class Solution: def isGood(self, nums: List[int]) -> bool: n = max(nums) base = [i fo.. 2024. 2. 14.
leetcode 3024. Type of Triangle https://leetcode.com/problems/type-of-triangle/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 10 11 12 class Solution: def triangleType(self, nums: List[int]) -> str: nums.sort() if sum(nums).. 2024. 2. 13.
leetcode 3033. Modify the Matrix https://leetcode.com/problems/modify-the-matrix/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 class Solution: def modifiedMatrix(self, matrix: List[List[int]]) .. 2024. 2. 13.
leetcode 2357. Make Array Zero by Subtracting Equal Amounts https://leetcode.com/problems/make-array-zero-by-subtracting-equal-amounts/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1234567class Solution: def minimumOperations(self, nums: List[int]) -> int: nums = list.. 2024. 2. 9.
leetcode 2586. Count the Number of Vowel Strings in Range https://leetcode.com/problems/count-the-number-of-vowel-strings-in-range/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 class Solution: def vowelStrings(self, words: List[st.. 2024. 2. 9.
leetcode 2937. Make Three Strings Equal https://leetcode.com/problems/make-three-strings-equal/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Solution: def findMinimumOperations(self, s1: str, s2: str, s3: str).. 2024. 2. 8.
leetcode 3028. Ant on the Boundary https://leetcode.com/problems/ant-on-the-boundary/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 class Solution: def returnToBoundaryCount(self, nums: List[int]) -> int: location = answer = 0 f.. 2024. 2. 6.
leetcode 3019. Number of Changing Keys https://leetcode.com/problems/number-of-changing-keys/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 class Solution: def countKeyChanges(self, s: str) -> int: answer = 0 for i in range(1, len.. 2024. 2. 5.
leetcode 3014. Minimum Number of Pushes to Type Word I https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-i/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Solution: def minimumPushes(self, word: str) -> int: .. 2024. 1. 23.
leetcode 3010. Divide an Array Into Subarrays With Minimum Cost I https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/description/ LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 from itertools import combinations class Solution: def minimumC.. 2024. 1. 23.
leetcode 645. Set Mismatch https://leetcode.com/problems/set-mismatch/description/?envType=daily-question&envId=2024-01-22 LeetCode - The World's Leading Online Programming Learning Platform 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 1 2 3 4 5 6 7 8 9 10 11 12 13 class Solution: def findErrorNums(self, nums: Lis.. 2024. 1. 22.