LeetCode Problems/Easy2 😍 LeetCode Easy Collections II - 15 Problems 0283. Move Zeroes / 0344. Reverse Stringclass Solution: def moveZeroes(self, nums: List[int]) -> None: """ Do not return anything, modify nums in-place instead. """ length=len(nums) if length != 1: first_encountered = False for x in range(length-1): if nums[x] == 0: if not first_encountered: .. LeetCode Problems/Easy 2024. 9. 2. 😊 LeetCode Easy Collections I - 20 Problems 0001. Two Sum / 0268. Missing Numberclass Solution: def twoSum(self, nums: List[int], target: int) -> List[int]: dct = dict() for i in range(len(nums)): dct[nums[i]] = i for i in range(len(nums)): if (target-nums[i]) in dct: if i!=dct[target-nums[i]]: return [i,dct[target-nums[i]]]class Solution: def missingNumber.. LeetCode Problems/Easy 2024. 8. 5. 이전 1 다음