CodingTest에 해당하는 글 63

  1. [LeetCode] Leaf-Similar Trees 2025.05.14

    https://leetcode.com/problems/leaf-similar-trees/description/?envType=study-plan-v2&envId=leetcode-75 Consider all the leaves of a binary tree, from left to right order, the values of those leaves form a leaf value sequence.For example, in the given tree above, the leaf value sequence is (6, 7, 4, 9, 8). Two binary trees are considered leaf-similar if their leaf value sequence is the same. Retur..


  2. [LeetCode] Maximum Depth of Binary Tree 2025.05.13

    https://leetcode.com/problems/maximum-depth-of-binary-tree/description/?envType=study-plan-v2&envId=leetcode-75 Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Example 1:Input: root = [3,9,20,null,null,15,7] Output: 3 Example 2: Input: root = [1,null,2] Output:..


  3. [LeetCode] Dota2 Senate 2025.05.12

    https://leetcode.com/problems/dota2-senate/?envType=study-plan-v2&envId=leetcode-75 In the world of Dota2, there are two parties: the Radiant and the Dire. The Dota2 senate consists of senators coming from two parties. Now the Senate wants to decide on a change in the Dota2 game. The voting for this change is a round-based procedure. In each round, each senator can exercise one of the two rights..


  4. [LeetCode] Delete the Middle Node of a Linked List 2025.05.08

    보호되어 있는 글입니다.


  5. [LeetCode] Number of Recent Calls 2025.05.07

    You have a RecentCounter class which counts the number of recent requests within a certain time frame. Implement the RecentCounter class:RecentCounter() Initializes the counter with zero recent requests. int ping(int t) Adds a new request at time t, where t represents some time in milliseconds, and returns the number of requests that has happened in the past 3000 milliseconds (including the new ..


  6. [LeetCode] Decode String 2025.05.04

    https://leetcode.com/problems/decode-string/description/?envType=study-plan-v2&envId=leetcode-75 Given an encoded string, return its decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer. You may assume that the input string is always valid; there are no ex..


  7. [LeetCode] Asteroid Collision 2025.05.01

    https://leetcode.com/problems/asteroid-collision/description/?envType=study-plan-v2&envId=leetcode-75 We are given an array asteroids of integers representing asteroids in a row. The indices of the asteriod in the array represent their relative position in space. For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative mea..


  8. [LeetCode] Removing Stars From a String 2025.04.30

    https://leetcode.com/problems/removing-stars-from-a-string/description/?envType=study-plan-v2&envId=leetcode-75 You are given a string s, which contains stars *. In one operation, you can: Choose a star in s. Remove the closest non-star character to its left, as well as remove the star itself. Return the string after all stars have been removed. Note: The input will be generated such that the op..


  9. [LeetCode] Equal Row and Column Pairs 2025.04.29

    https://leetcode.com/problems/equal-row-and-column-pairs/description/?envType=study-plan-v2&envId=leetcode-75 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 the same elements in the same order (i.e., an equal array).Example 1:Input: grid = [[3,2,1],[1,7,6],[2,7,7]..


  10. [LeetCode] Determine if Two Strings Are Close 2025.04.28

    https://leetcode.com/problems/determine-if-two-strings-are-close/description/?envType=study-plan-v2&envId=leetcode-75 Two strings are considered close if you can attain one from the other using the following operations: Operation 1: Swap any two existing characters. For example, abcde -> aecdb Operation 2: Transform every occurrence of one existing character into another existing character, and ..