본문 바로가기

leet code41

[LEET CODE] 3. Longest Substring Without Repeating Characters # Problem Given a string s, find the length of the longest substring without repeating characters. Constraints: 0 2021. 4. 5.
[LEET CODE] 771. Jewels and Stones # Problem 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". Constraints: 1 int: freqs = {} count = 0 # 돌(S)의 빈도 수 계산 for.. 2021. 4. 5.
[LEET CODE] 706. Design HashMap # Problem Design a HashMap without using any built-in hash table libraries. Implement the MyHashMap class: MyHashMap() initializes the object with an empty map. void put(int key, int value) inserts a (key, value) pair into the HashMap. If the key already exists in the map, update the corresponding value. int get(int key) returns the value to which the specified key is mapped, or -1 if this map c.. 2021. 4. 5.
❗️[LEET CODE] 23. Merge k Sorted Lists ( k개 정렬 리스트 병합) # Problem You are given an array of k linked-lists lists, each linked-list is sorted in ascending order. Merge all the linked-lists into one sorted linked-list and return it. Constraints: k == lists.length 0 2021. 4. 1.
❗️[LEET CODE] 641. Design Circular Deque # Problem Design your implementation of the circular double-ended queue (deque). Your implementation should support following operations: MyCircularDeque(k): Constructor, set the size of the deque to be k. insertFront(): Adds an item at the front of Deque. Return true if the operation is successful. insertLast(): Adds an item at the rear of Deque. Return true if the operation is successful. dele.. 2021. 3. 31.
[코딩 + 알고리즘 완주반] 17일차. 재귀용법, 동적계획법과 분할정복 # 재귀 용법 함수 안에서 동일한 함수를 호출 # 일반적인 형태 # 일반적인 형태1 def function(입력): if 입력 > 일정값: # 입력이 일정 값 이상이면 return function(입력 - 1) # 입력보다 작은 값 else: return 일정값, 입력값, 또는 특정값 # 재귀 호출 종료 # 일반적인 형태2 def function(입력): if 입력 2021. 3. 31.
반응형