LeetCode342 Leetcode 1. Two Sum 1 2 3 4 5 6 7 8 9 10 class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: for i in range(len(nums)): for j in range(i+1,len(nums)): if target== nums[i]+nums[j]: tmp=[] tmp.append(i) tmp.append(j) return tmp break Colored by Color Scripter cs 2021. 7. 12. Leetcode 1672. Richest Customer Wealth 1 2 3 4 5 6 7 class Solution: def maximumWealth(self, accounts: List[List[int]]) -> int: tmp=[] for i in range(len(accounts)): tmp.append( sum(accounts[i])) return max(tmp) Colored by Color Scripter cs 2021. 7. 12. Leetcode 1108. Defanging an IP Address 1234class Solution: def defangIPaddr(self, address: str) -> str: address=address.replace('.','[.]') return addresscs 2021. 7. 12. Leetcode 1480. Running Sum of 1d Array 1 2 3 4 5 6 class Solution: def runningSum(self, nums: List[int]) -> List[int]: tmp=[] for i in range(len(nums)): tmp.append(sum(nums[:i+1])) return tmp Colored by Color Scripter cs 2021. 7. 12. Leetcode 1920 1 2 3 4 5 6 class Solution: def buildArray(self, nums: List[int]) -> List[int]: tmp=[] for i in nums: tmp.append(nums[i]) return tmp Colored by Color Scripter cs 2021. 7. 12. Leetcode 1929 1 2 3 4 5 6 7 class Solution: def getConcatenation(self, nums: List[int]) -> List[int]: tmp=[] for i in range(2): for j in nums: tmp.append(j) return tmp Colored by Color Scripter cs 2021. 7. 12. 이전 1 ··· 26 27 28 29 다음