일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 파이썬
- 릿코드
- array
- Greedy
- GenAI
- 생성형AI
- slidingwindow
- LeetCode
- SQL
- dfs
- Python3
- 리트코드
- Python
- 알고리즘
- 슬라이딩윈도우
- sql코테
- codeup
- nlp
- Stack
- 자연어처리
- stratascratch
- 투포인터
- 니트코드
- GenerativeAI
- 파이썬기초100제
- heap
- 코드업
- two-pointer
- 파이썬알고리즘
- gcp
- Today
- Total
목록2025/06 (8)
Tech for good

https://leetcode.com/problems/remove-all-adjacent-duplicates-in-string/ class Solution: def removeDuplicates(self, s: str) -> str: stack = [] for c in s: if stack and stack[-1] == c: stack.pop() else: stack.append(c) return ''.join(stack)

def has_all_unique_characters(s): unique_chars = set(s) if len(s) == len(unique_chars): return True else: return False Using SetsSets are collections of unique elements. You can convert a string into a set to get its unique characters.The order of characters is not guaranteed in a set. text = "programming" unique_chars = set(text) print(unique_chars) # Output: {'g'..

https://leetcode.com/problems/jump-game/description/class Solution: def canJump(self, nums: List[int]) -> bool: max_reach = 0 for i in range(len(nums)): if i > max_reach: return False # Current index is unreachable max_reach = max(max_reach, i + nums[i]) # Update the farthest reachable index return True✅ Explanation:max_reach keeps t..

🔗 What Is a Linked List?A linked list is a linear data structure where each element (node) points to the next one in the sequence.Unlike arrays, which store elements in contiguous memory, a linked list connects scattered nodes using pointers. 🧱 Structure of a NodeEach node in a singly linked list has:val: the data (value)next: a reference (or pointer) to the next nodeExample:class ListNode: ..

# The knows API is already defined for you.# return a bool, whether a knows b# def knows(a: int, b: int) -> bool:class Solution: def findCelebrity(self, n: int) -> int: # Step 1: Find the celebrity candidate candidate = 0 for i in range(1, n): if knows(candidate, i): # Candidate knows i → candidate is not the celebrity candidate = ..

class Solution: def findJudge(self, n: int, trust: List[List[int]]) -> int: # If there's only one person and no trust relationships, that person is the judge if n == 1 and not trust: return 1 # Initialize trust counts trust_scores = [0] * (n+1) for a,b in trust: trust_scores[a] -= 1 # a trusts someone → cannot be the judge ..

https://neetcode.io/problems/linked-list-cycle-detection?list=neetcode150 NeetCode neetcode.ioLinked List (토끼와 거북이 경주 -> 속도가 다르더라도 결국 만나게 된다!)# Definition for singly-linked list.# class ListNode:# def __init__(self, val=0, next=None):# self.val = val# self.next = nextclass Solution: def hasCycle(self, head: Optional[ListNode]) -> bool: if not head or not head.next: ..

https://neetcode.io/problems/merge-two-sorted-linked-lists?list=neetcode150 NeetCode neetcode.io# Definition for singly-linked list.# class ListNode:# def __init__(self, val=0, next=None):# self.val = val# self.next = nextclass Solution: def mergeTwoLists(self, list1: Optional[ListNode], list2: Optional[ListNode]) -> Optional[ListNode]: # Dummy node to simplify the ..