PS

    LeetCode / Tree / 1161번 / Maximum Level Sum of a Binary Tree / JS

    Maximum Level Sum of a Binary Tree - LeetCode Can you solve this real interview question? Maximum Level Sum of a Binary Tree - Given the root of a binary tree, the level of its root is 1, the level of its children is 2, and so on. Return the smallest level x such that the sum of all the values of node leetcode.com 트리에서 각 층을 이루는 노드들의 합을 구했을 때, 그 합이 가장 큰 층이 몇 층인지 반환하는 문제이다...

    LeetCode / Tree / 530번 / Minimum Absolute Difference in BST / JS

    Minimum Absolute Difference in BST - LeetCode Can you solve this real interview question? Minimum Absolute Difference in BST - Given the root of a Binary Search Tree (BST), return the minimum absolute difference between the values of any two different nodes in the tree. Example 1: [https://assets.l leetcode.com BST(Binary Search Tree)를 이루는 모든 노드들 중에서 2개의 노드를 뽑아 뺐을 때, 가장 작..

    LeetCode / Matrix / 2352번 / Equal Row and Column Pairs / JS

    Equal Row and Column Pairs - LeetCode Can you solve this real interview question? Equal Row and Column Pairs - Given a 0-indexed n x n integer matrix grid, return the number of pairs (ri, cj) such that row ri and column cj are equal. A row and column pair is considered equal if they contain th leetcode.com 각 행과 각 열을 모두 나누어서 봤을 때, 행과 열을 이루는 값들이 같으면 카운트를 하나 더해서 최종 카운트를 반환하는..

    LeetCode / Array / 228번 / Summary Ranges / JS

    Summary Ranges - LeetCode Can you solve this real interview question? Summary Ranges - You are given a sorted unique integer array nums. A range [a,b] is the set of all integers from a to b (inclusive). Return the smallest sorted list of ranges that cover all the numbers in the arr leetcode.com 연속수를 이루는 모든 범위를 배열에 담아서 반환한다. /** * @param {number[]} nums * @return {string[]..

    LeetCode / Design / 155번 / Min Stack / JS

    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 stack의 메소드들을 구현하는데 추가로 getMin()을 구현한다. getMin()은 스택의 값중에서 가장 작은값을 반환한다. 그 외 기본 메소드는..

    LeetCode / Design / 232번 / Implement Queue using Stacks / JS

    Implement Queue using Stacks - LeetCode Can you solve this real interview question? Implement Queue using Stacks - Implement a first in first out (FIFO) queue using only two stacks. The implemented queue should support all the functions of a normal queue (push, peek, pop, and empty). Implement t leetcode.com queue의 메소드인 push, peek, pop, empty를 두 개의 stack을 이용해서 구현한다. var M..