일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- leetcode풀기
- 잇츠디모
- 알고리즘풀기
- 릿코드 파이썬
- 파이썬릿코드풀기
- python 릿코드
- 릿코드풀이
- binary search
- 상가수익률계산기
- 릿코드
- 코틀린기초
- python 알고리즘
- python Leetcode
- LeetCode
- 파이썬알고리즘
- python xor
- python priority queue
- python sorted
- python zip_longest
- leetcode풀이
- 파이썬 릿코드
- 릿코드 풀기
- 파이썬 프로그래머스
- 파이썬 알고리즘
- 릿코드풀기
- 파이썬릿코드
- leetcode 풀기
- 파이썬알고리즘풀기
- 파이썬 알고리즘 풀기
- 알고리즘풀이
- Today
- Total
목록알고리즘/LeetCode (177)
소프트웨어에 대한 모든 것
283. Move Zeroes https://leetcode.com/problems/move-zeroes/ Move Zeroes - 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) 연산 수행 속도를 최소화하는 것이 follow up에 명시되어 있네요. 문제 자체는 쉬웠는데 속도가 너무 느리네요. 시간 복잡도가 O(n^2)입니다. 풀이 전략: 1) 배열에서 0에 해당하는 모든 인덱스를 검색 2) 0에 해당하는 요소의 마지막에 있는 것 부터 뒤로 s..
46. Permutations https://leetcode.com/problems/permutations/ Permutations - 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) 처음 문제 접근은 계속 nums의 index를 반복문으로 변경해가면서 풀려고 했더니 문제가 풀리지 않았다. 아래와 같이 그림을 그리면서 생각을 해보니 백트래킹 방식으로 문제를 쉽게 풀 수 있을 것이라는 생각이 들었다. nums가 [1, 2, 3]을 예시로 설명한 그..
43. Multiply Strings https://leetcode.com/problems/multiply-strings/ Multiply Strings - 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) Built-in BigInteger library를 사용하지 말아햐 하는 조건이 있다. string을 number로 바꾸는 함수를 만들어야한다. class Solution: def multiply(self, num1: str, num2: str..
1704. Determine if String Halves Are Alike https://leetcode.com/problems/determine-if-string-halves-are-alike/ Determine if String Halves Are Alike - 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 halvesAreAlike(self, s: str) -> bool: vowels = ('a', '..
189. Rotate Array https://leetcode.com/problems/rotate-array/ Rotate Array - 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) 공간복잡도를 O(N)으로 생각하면 굉장히 심플한 문제이다. 1) 임시 배열 생성 2) nums에서 k만큼 이동한 index에 값을 임시 배열에 넣는다 3) 임시 배열의 값을 nums에 복사 class Solution: def rotate(self, nums: Li..
278. First Bad Version https://leetcode.com/problems/first-bad-version/ First Bad Version - 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) 바이너리 서치를 방법을 사용한다. # The isBadVersion API is already defined for you. # @param version, an integer # @return an integer # def isBadV..
704. Binary Search https://leetcode.com/problems/binary-search/ Binary Search - 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) 이진 탐색 (binary search) class Solution: def search(self, nums: List[int], target: int) -> int: left = 0 right = len(nums) while left < right: mid ..
890. Find and Replace Pattern https://leetcode.com/problems/find-and-replace-pattern/ Find and Replace Pattern - 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 findAndReplacePattern(self, words: List[str], pattern: str) -> List[str]: matched = [] uniq..