본문 바로가기

분류 전체보기

(174)
[Leetcode] 283. Move Zeroes https://leetcode.com/problems/move-zeroes/ class Solution: def moveZeroes(self, nums: List[int]) -> None: count = nums.count(0) if count == len(nums): return for i in range(count): nums.remove(0) nums.append(0)
[Leetcode] 1378. Replace Employee ID With The Unique Identifier https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier/ SELECT u.unique_id, e.name FROM Employees AS e LEFT JOIN EmployeeUNI AS u ON e.id = u.id;
[Leetcode] 595. Big Countries https://leetcode.com/problems/big-countries/ SELECT name, population, area FROM world WHERE area >= 3000000 OR population >= 25000000;
[Leetcode] 584. Find Customer Referee https://leetcode.com/problems/find-customer-referee/ SELECT name FROM Customer WHERE referee_id IS NULL OR referee_id != 2;
[Leetcode] 1757. Recyclable and Low Fat Products https://leetcode.com/problems/recyclable-and-low-fat-products/ SELECT product_id FROM Products WHERE low_fats = "Y" AND recyclable = "Y";
[Leetcode] 1346. Check If N and Its Double Exist https://leetcode.com/problems/check-if-n-and-its-double-exist/ class Solution: def checkIfExist(self, arr: List[int]) -> bool: arr.sort() for i in range(len(arr)): for j in range(len(arr)): if i == j: continue if arr[i] * 2 == arr[j]: return True return False
[Leetcode] 977. Squares of a Sorted Array https://leetcode.com/problems/squares-of-a-sorted-array/ class Solution: def sortedSquares(self, nums: List[int]) -> List[int]: nums = sorted(nums, key=abs) return [i * i for i in nums]
[Leetcode] 1295. Find Numbers with Even Number of Digits https://leetcode.com/problems/find-numbers-with-even-number-of-digits/submissions/ class Solution: def findNumbers(self, nums: List[int]) -> int: count = 0 for num in nums: if len(str(num)) % 2 == 0: count += 1 return count

728x90