일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 알고리즘풀이
- leetcode풀기
- 파이썬릿코드풀기
- python sorted
- 파이썬 알고리즘 풀기
- 파이썬 릿코드
- LeetCode
- 파이썬 프로그래머스
- python 알고리즘
- 릿코드
- python Leetcode
- 알고리즘풀기
- 릿코드 파이썬
- leetcode풀이
- 릿코드 풀기
- 잇츠디모
- 릿코드풀기
- python 릿코드
- 파이썬알고리즘풀기
- 파이썬알고리즘
- 상가수익률계산기
- python xor
- 파이썬 알고리즘
- 파이썬릿코드
- python priority queue
- python zip_longest
- 코틀린기초
- leetcode 풀기
- 릿코드풀이
- binary search
- Today
- Total
목록python Leetcode (53)
소프트웨어에 대한 모든 것
347. Top K Frequent Elements https://leetcode.com/problems/top-k-frequent-elements/ Top K Frequent Elements - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) Counter 객체 사용 class Solution: def topKFrequent(self, nums: List[int], k: int) -> List[int]: counter = Counter(nums..
165. Compare Version Numbers https://leetcode.com/problems/compare-version-numbers/ Compare Version Numbers - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) zip_longest 함수 활용 from itertools import zip_longest class Solution: def compareVersion(self, version1: str, versio..
121. Best Time to Buy and Sell Stock https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Best Time to Buy and Sell Stock - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) Bruete-Force Brute-force 방식으로 풀면 시간 초과가 발생하네요. 시간 복잡도 : O(n^2) # Time Limit Exceeded class..
200. Number of Islands https://leetcode.com/problems/number-of-islands/ Number of Islands - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) DFS class Solution(object): def numIslands(self, grid): """ :type grid: List[List[str]] :rtype: int """ m,n = len(grid), len(grid[0]..
692. Top K Frequent Words https://leetcode.com/problems/top-k-frequent-words/ Top K Frequent Words - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) sorted() 다중 정렬 sorted() 함수의 다중 정렬을 사용하면 문제를 쉽게 해결할 수 있습니다. class Solution(object): def topKFrequent(self, words, k): """ :t..
169. Majority Element https://leetcode.com/problems/majority-element/ Majority Element - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) class Solution: def majorityElement(self, nums: List[int]) -> int: half = len(nums)//2 counter = Counter(nums) for n, count in counter...
1288. Remove Covered Intervals https://leetcode.com/problems/remove-covered-intervals/ Remove Covered Intervals - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) class Solution: def removeCoveredIntervals(self, nums: List[List[int]]) -> int: count = len(nums) # 오름차순 정렬 nu..
389. Find the Difference https://leetcode.com/problems/find-the-difference/ Find the Difference - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 문제) 솔루션1) HashMap 각각의 해쉬맵 구성. 원래 문자의 hashmap에서 random 생성된 문자 해쉬맵을 하나씩 제거해나가서 최종적으로 남은 것이 추가된 문자가됩니다. class Solution: def findTheDifferen..