일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- python xor
- 릿코드풀이
- leetcode풀이
- python zip_longest
- 릿코드풀기
- 릿코드 풀기
- 파이썬릿코드
- 파이썬알고리즘풀기
- 알고리즘풀이
- python 릿코드
- binary search
- 파이썬 프로그래머스
- 파이썬 알고리즘 풀기
- leetcode풀기
- 릿코드
- LeetCode
- 알고리즘풀기
- 파이썬 릿코드
- python priority queue
- 코틀린기초
- python Leetcode
- python sorted
- 파이썬 알고리즘
- 잇츠디모
- 파이썬알고리즘
- python 알고리즘
- 릿코드 파이썬
- leetcode 풀기
- 상가수익률계산기
- 파이썬릿코드풀기
- Today
- Total
목록leetcode풀기 (8)
소프트웨어에 대한 모든 것

260. Single Number III https://leetcode.com/problems/single-number-iii/ Single Number III - 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 or HashSet 자료구조를 통해서 중복을 제거하고 single number만 남겨서 문제를 해결한다. 아래 코드에서는 HashMap 사용. 시간 복잡도 : O(N) 공간 복잡도 : O(N) class Solutio..

1732. Find the Highest Altitude https://leetcode.com/problems/find-the-highest-altitude/ Find the Highest Altitude - 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 largestAltitude(self, gain: List[int]) -> int: # The biker starts his trip on point 0 a..

1877. Minimize Maximum Pair Sum in Array https://leetcode.com/problems/minimize-maximum-pair-sum-in-array/ Minimize Maximum Pair Sum in 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) 오름차순 정렬 후 최소, 최대 pair를 계속 구해나가서 max를 구한다. class Solution: def minPairSum(self, n..

1464. Maximum Product of Two Elements in an Array https://leetcode.com/problems/maximum-product-of-two-elements-in-an-array/ Maximum Product of Two Elements in an 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(nlogn) class Solution: def maxProduct(self, nums: L..

1816. Truncate Sentence https://leetcode.com/problems/truncate-sentence/ Truncate Sentence - 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 truncateSentence(self, s: str, k: int) -> str: return ' '.join(s.split()[:k])

1913. Maximum Product Difference Between Two Pairs https://leetcode.com/problems/maximum-product-difference-between-two-pairs/ Maximum Product Difference Between Two Pairs - 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(nlogn) 공간 복잡도 : O(1) class Solution: de..

771. Jewels and Stones 문제) You're given strings jewels representing the types of stones that are jewels, and stones representing the stones you have. Each character in stones is a type of stone you have. You want to know how many of the stones you have are also jewels. Letters are case sensitive, so "a" is considered a different type of stone from "A". 솔루션1) class Solution: def numJewelsInStones..

461. Hamming Distance 문제) 솔루션1) xor 연산을 취한 후 비트연산 class Solution: def hammingDistance(self, x: int, y: int) -> int: xor = x ^ y return sum((xor>>i & 1) for i in range(31)) 솔루션2) xor 연산을 취한 후 내장함수 bin()을 사용해서 이진수 문자열로 변환 후 1을 셈 class Solution: def hammingDistance(self, x: int, y: int) -> int: xor = x^y return bin(xor).count('1')