본문 바로가기
반응형

Problem Solving232

[리트코드 leetcode] 238. Product of Array Except Self leetcode.com/problems/product-of-array-except-self/ Product of Array Except Self - 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 class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: output = [] left = 1 right = 1 for i in range(len(nums)): output.append(left.. 2021. 4. 12.
[리트코드 leetcode] 561. Array Partition I leetcode.com/problems/array-partition-i/ Array Partition I - 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 class Solution: def arrayPairSum(self, nums: List[int]) -> int: nums.sort() sum =0 for i in range(0,len(nums),2): sum +=nums[i] return sum 2021. 4. 12.
[리트코드 leetcode] 42. Trapping Rain Water Problem : leetcode.com/problems/trapping-rain-water/ Trapping Rain Water - 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: class Solution: def trap(self, height: List[int]) -> int: left = right = 0 left_h = [] right_h = [] for value in height: left = max(value,left) left_.. 2021. 4. 12.
[리트코드 leetcode] 819. Most Common Word Problem : leetcode.com/problems/most-common-word/ Most Common Word - 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: class Solution: def mostCommonWord(self, paragraph: str, banned: List[str]) -> str: words = [] processing = re.sub('[^a-zA-Z]',' ',paragraph).lower().split.. 2021. 4. 12.
반응형