LeetCode342 leetcode 1581. Customer Who Visited but Did Not Make Any Transactions 1 2 3 4 5 6 7 8 /* Write your PL/SQL query statement below */ select customer_id, count(visit_id) as count_no_trans from visits where visit_id not in ( select visit_id from transactions ) group by customer_id Colored by Color Scripter cs 2022. 3. 30. leetcode 1795. Rearrange Products Table 1 2 3 4 5 6 7 8 9 /* Write your PL/SQL query statement below */ select * from( select product_id, 'store1' store, store1 price from products union select product_id, 'store2' store, store2 price from products union select product_id, 'store3' store, store3 price from products ) where price is not null; Colored by Color Scripter cs 2022. 3. 30. leetcode 1587. Bank Account Summary II 1 2 3 4 5 6 7 /* Write your PL/SQL query statement below */ select u.name, sum(t.amount) as balance from users u join Transactions t on u.account=t.account group by u.name having sum(t.amount)>10000 cs 2022. 3. 30. leetcode 1873. Calculate Special Bonus 1 2 3 4 5 /* Write your PL/SQL query statement below */ select employee_id ,case when mod(employee_id, 2)=1 and substr(name,1,1)!='M' then salary else 0 end as bonus from employees; Colored by Color Scripter cs 2022. 3. 29. leetcode 1693. Daily Leads and Partners 1 2 3 4 5 6 7 8 /* Write your PL/SQL query statement below */ select to_char(date_id, 'yyyy-mm-dd') as date_id , make_name , count(distinct lead_id) as unique_leads , count(distinct partner_id) as unique_partners from DailySales group by date_id, make_name cs 2022. 3. 29. leetcode 1741. Find Total Time Spent by Each Employee 1 2 3 4 5 /* Write your PL/SQL query statement below */ select TO_CHAR(event_day, 'YYYY-MM-DD') as day, emp_id, sum(out_time - in_time) as total_time from Employees group by event_day, emp_id order by 1, 2, 3 Colored by Color Scripter cs 2022. 3. 29. leetcode 896. Monotonic Array 1 2 3 4 5 6 class Solution: def isMonotonic(self, nums: List[int]) -> bool: ans=False if nums == sorted(nums) or nums==sorted(nums,reverse=True) : ans=True return ans Colored by Color Scripter cs 2022. 3. 28. leetcode 1185. Day of the Week 1 2 3 4 from datetime import datetime class Solution: def dayOfTheWeek(self, day: int, month: int, year: int) -> str: return datetime(year,month,day).strftime('%A') cs 2022. 3. 28. leetcode 448. Find All Numbers Disappeared in an Array 1 2 3 4 class Solution: def findDisappearedNumbers(self, nums: List[int]) -> List[int]: n=len(nums) return set(range(1,n+1))-set(nums) cs 2022. 3. 28. Leetcode 268. Missing Number 1 2 3 4 5 6 class Solution: def missingNumber(self, nums: List[int]) -> int: nums_sum=sum(nums) n=len(nums) compared=n*(n+1)//2 return compared-nums_sum cs 2022. 3. 28. leetcode 2129. Capitalize the Title 1 2 3 4 5 6 7 8 9 10 11 12 13 class Solution: def capitalizeTitle(self, title: str) -> str: titleList=list(title.split()) ans='' for i in titleList : i = i.lower() if len(i) 2022. 3. 25. leetcode 217. Contains Duplicate 1 2 3 4 5 6 class Solution: def containsDuplicate(self, nums: List[int]) -> bool: ans=False numsSet=list(set(nums)) if sorted(nums) != sorted(numsSet) : ans=True return ans Colored by Color Scripter cs 2022. 3. 24. 이전 1 ··· 17 18 19 20 21 22 23 ··· 29 다음