Eat Study Love

먹고 공부하고 사랑하라

코딩공부 88

Deque 자료구조 만들어보기

https://leetcode.com/problems/design-circular-deque/사실 예전에 풀었던 문제인데, 다행히(?) 인간은 망각의 동물인지라 초면 인 것 마냥 풀었다. deque 구조의 delete / insert 등등의 method를 한번 구현해 보는 것이 골자! Design your implementation of the circular double-ended queue (deque).Implement the MyCircularDeque class:MyCircularDeque(int k) Initializes the deque with a maximum size of k.boolean insertFront() Adds an item at the front of Deque. Retu..

Coding_Practice 2024.10.27

My Calendar II[Array,Binary Search,Design,Segment Tree,Prefix Sum,Ordered Set]

https://leetcode.com/problems/my-calendar-ii/description/You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a triple booking.A triple booking happens when three events have some non-empty intersection (i.e., some moment is common to all the three events.).The event can be represented as a pair of integers start and end that represent..

Coding_Practice 2024.10.24

MinMaxDivision(Divide array A into K blocks and minimize the largest sum of any block)

https://app.codility.com/programmers/lessons/14-binary_search_algorithm/min_max_division/ MinMaxDivision coding task - Learn to Code - CodilityDivide array A into K blocks and minimize the largest sum of any block.app.codility.comYou are given integers K, M and a non-empty array A consisting of N integers. Every element of the array is not greater than M.You should divide this array into K block..

Coding_Practice 2024.10.16

Longest Nice Substring[Hash Table,String,Divide and Conquer,Bit Manipulation,Sliding Window]

https://leetcode.com/problems/longest-nice-substring/description/A string s is nice if, for every letter of the alphabet that s contains, it appears both in uppercase and lowercase. For example, "abABB" is nice because 'A' and 'a' appear, and 'B' and 'b' appear. However, "abA" is not because 'b' appears, but 'B' does not.Given a string s, return the longest substring of s that is nice. If there ..

Coding_Practice 2024.10.10