분류 전체보기
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..
LeetCode / Tree / 199번 / Binary Tree Right Side View / JS
Binary Tree Right Side View - LeetCode Can you solve this real interview question? Binary Tree Right Side View - Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 1: [https://asse leetcode.com 주어진 트리에서 각 depth(layer) 마다의 가장 오른쪽 노드만 모아서 반환하는 문제이다. /** * Definiti..
LeetCode / Tree / 101번 / Symmetric Tree / JS
Symmetric Tree - LeetCode Can you solve this real interview question? Symmetric Tree - Given the root of a binary tree, check whether it is a mirror of itself (i.e., symmetric around its center). Example 1: [https://assets.leetcode.com/uploads/2021/02/19/symtree1.jpg] Input: roo leetcode.com 주어진 트리가 좌우대칭을 이루는지 판별하여 boolean 값을 반환하는 문제이다. /** * Definition for a binary tree ..
LeetCode / Tree / 100번 / Same Tree / JS
Same Tree - LeetCode Can you solve this real interview question? Same Tree - Given the roots of two binary trees p and q, write a function to check if they are the same or not. Two binary trees are considered the same if they are structurally identical, and the nodes have the leetcode.com 주어진 두 트리가 구조적으로 같은 트리인지 판단해서 boolean 값을 반환하는 문제이다. /** * Definition for a binary tre..
LeetCode / Two Pointer / 16번 / 3Sum Closese / JS
3Sum Closest - LeetCode Can you solve this real interview question? 3Sum Closest - Given an integer array nums of length n and an integer target, find three integers in nums such that the sum is closest to target. Return the sum of the three integers. You may assume that each inp leetcode.com 주어진 nums 배열에서 3개의 수를 뽑아서 더했을 때, target 값과 가장 가까운 값을 반환하면 된다. /** * @param {numbe..
LeetCode / Dynamic Programming / 416번 / Partition Equal Subset Sum / JS
Partition Equal Subset Sum - LeetCode Can you solve this real interview question? Partition Equal Subset Sum - Given an integer array nums, return true if you can partition the array into two subsets such that the sum of the elements in both subsets is equal or false otherwise. Example 1: I leetcode.com 주어진 nums 배열을 둘의 부분집합으로 나누었을 때, 그 둘의 부분집합 각각의 합이 같을 경우 true, 아니라면 fals..