[Medium] 341. Flatten Nested List Iterator
React 2022. 7. 27. 09:52

문제 You are given a nested list of integers nestedList. Each element is either an integer or a list whose elements may also be integers or other lists. Implement an iterator to flatten it. Implement the NestedIterator class: NestedIterator(List nestedList) Initializes the iterator with the nested list nestedList. int next() Returns the next integer in the nested list. boolean hasNext() Returns tr..

[Medium] 155. Min Stack
leetCode 2022. 7. 27. 09:47

문제 Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. Implement the MinStack class: MinStack() initializes the stack object. void push(int val) pushes the element val onto the stack. void pop() removes the element on the top of the stack. int top() gets the top element of the stack. int getMin() retrieves the minimum element in the stack. You must i..

[Medium] 1845. Seat Reservation Manager
leetCode 2022. 7. 26. 00:27

문제 Design a system that manages the reservation state of n seats that are numbered from 1 to n. Implement the SeatManager class: SeatManager(int n) Initializes a SeatManager object that will manage n seats numbered from 1 to n. All seats are initially available. int reserve() Fetches the smallest-numbered unreserved seat, reserves it, and returns its number. void unreserve(int seatNumber) Unrese..

[Easy] 860. Lemonade Change
leetCode 2022. 7. 26. 00:11

문제 At a lemonade stand, each lemonade costs $5. Customers are standing in a queue to buy from you and order one at a time (in the order specified by bills). Each customer will only buy one lemonade and pay with either a $5, $10, or $20 bill. You must provide the correct change to each customer so that the net transaction is that the customer pays $5. Note that you do not have any change in hand ..

[Medium] 445. Add Two Numbers II
카테고리 없음 2022. 7. 19. 11:37

https://leetcode.com/problems/add-two-numbers-ii/ Add Two Numbers II - 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 문제 You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contains a singl..

[Medium] 2. Add Two Numbers
leetCode 2022. 7. 19. 11:35

https://leetcode.com/problems/add-two-numbers/ Add Two Numbers - 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 문제 You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single dig..

[Medium] 138. Copy List with Random Pointer
leetCode 2022. 7. 19. 09:57

문제 https://leetcode.com/problems/copy-list-with-random-pointer/ Copy List with Random Pointer - 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 A linked list of length n is given such that each node contains an additional random pointer, which could point to any node in the list, o..

[Medium] 143. Reorder List
leetCode 2022. 7. 19. 09:54

문제 https://leetcode.com/problems/reorder-list/ Reorder List - 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 You are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → Ln Reorder the list to be on the following form: L0 → Ln → L1 → Ln - ..