[leetcode-1] Two Sum
ยท
๐ข One step
LeetCode-1 Two Sum : target๊ณผ ์ผ์นํ๋ ๋ฆฌ์คํธ ๋๊ฐ์ ํฉ note : OMyAnswer (O(n * n))class Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: len_nums = len(nums) if len_nums==2: return [0,1] for i in range(len(nums)): for j in range(i+1,len(nums)): if target==(nums[i]+nums[j]): return [i, j] Result : 3649ms Memory: 14.9mbAnswer O(n * n) (in์ ์๊ฐ ๋ณต์ก๋ n)class Solution: def twoSum(self, nums:..