LeetCode

LeetCode

[LeetCode] 155. Min Stack

Min Stack - LeetCode Can you solve this real interview question? Min Stack - 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 t leetcode.com Min값을 O(1)안에 반환하는 Stack을 구현하는 문제입니다. Example 1: ["MinStack","push","push","push","getMin","pop","top","getM..

LeetCode

[LeetCode] 74. Search a 2D Matrix

Search a 2D Matrix - LeetCode Can you solve this real interview question? Search a 2D Matrix - You are given an m x n integer matrix matrix with the following two properties: * Each row is sorted in non-decreasing order. * The first integer of each row is greater than the last integer leetcode.com int형 2차원 배열과 target 숫자가 주어지면 2차원 배열안에 target이 있는지 찾아 true or false를 반환하는 문제입니다. O(log(n*m))의 시간복잡도안..

LeetCode

[LeetCode] 21. Merge Two Sorted Lists

Merge Two Sorted Lists - LeetCode Can you solve this real interview question? Merge Two Sorted Lists - You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists leetcode.com 주어진 Lists 오름차순으로 합친 Node를 반환하는 문제입니다. Example 1: Input: list1 = [1,2,4], list2 = [1,3,4] Outpu..

LeetCode

[LeetCode] 35. Search Insert Position

Search Insert Position - LeetCode Can you solve this real interview question? Search Insert Position - Given a sorted array of distinct integers and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order. You must w leetcode.com 정렬된 int 배열과 target 넘버가 주어지면 배열중에서 target이 들어갈 위치가 어디인지 반환하는 문제입니다. 입출력 예시와 함께보면 쉽게 이해할 수 있습니다. ..

Sol b
'LeetCode' 카테고리의 글 목록 (6 Page)