PS/LeetCode
LeetCode / Array / 1582번 / Special Positions in a Binary Matrix / JS
Special Positions in a Binary Matrix - LeetCode Can you solve this real interview question? Special Positions in a Binary Matrix - Given an m x n binary matrix mat, return the number of special positions in mat. A position (i, j) is called special if mat[i][j] == 1 and all other elements in row i and co leetcode.com 2차원 배열에서 (i, j)의 값이 1이라면, 같은 행과 같은 열에 1이 (i, j)에만 존재했을 때..
LeetCode / Array / 2090번 / K Radius Subarray Averages / JS
K Radius Subarray Averages - LeetCode Can you solve this real interview question? K Radius Subarray Averages - You are given a 0-indexed array nums of n integers, and an integer k. The k-radius average for a subarray of nums centered at some index i with the radius k is the average of all elem leetcode.com 어떤 원이 k만큼의 반지름을 가질 때, 인덱스 하나마다 해당하는 요소를 중심으로 가질 때, 그 안에 들어오는 배열의 요..
LeetCode / Array / 1732번 / Find the Highest Altitude / JS
Find the Highest Altitude - LeetCode Can you solve this real interview question? Find the Highest Altitude - There is a biker going on a road trip. The road trip consists of n + 1 points at different altitudes. The biker starts his trip on point 0 with altitude equal 0. You are given an integ leetcode.com 고도들이 배열로 주어지는데, 고도들을 따라 계속해서 이동했을 때(누적 합), 가장 고도가 높은 곳의 고도를 반환하면 된다..
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 각 행과 각 열을 모두 나누어서 봤을 때, 행과 열을 이루는 값들이 같으면 카운트를 하나 더해서 최종 카운트를 반환하는..