전체 글에 해당하는 글 293

  1. [LeetCode] N-th Tribonacci Number 2025.05.21

    https://leetcode.com/problems/n-th-tribonacci-number/description/?envType=study-plan-v2&envId=leetcode-75 The Tribonacci sequence Tn is defined as follows: T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0.Given n, return the value of Tn. Example 1:Input: n = 4 Output: 4 Explanation: T_3 = 0 + 1 + 1 = 2 T_4 = 1 + 1 + 2 = 4Example 2:Input: n = 25 Output: 1389537 Constraints:0 The ans..


  2. [LeetCode] Fibonacci Number 2025.05.19

    https://leetcode.com/problems/fibonacci-number/The Fibonacci numbers, commonly denoted F(n) form a sequence, called the Fibonacci sequence, such that each number is the sum of the two preceding ones, starting from 0 and 1. That is, F(0) = 0, F(1) = 1 F(n) = F(n - 1) + F(n - 2), for n > 1. Given n, calculate F(n).Example 1: Input: n = 2 Output: 1 Explanation: F(2) = F(1) + F(0) = 1 + 0 = 1. Examp..


  3. [LeetCode] Path Sum III 2025.05.19

    보호되어 있는 글입니다.


  4. [LeetCode] Count Good Nodes in Binary Tree 2025.05.15

    https://leetcode.com/problems/count-good-nodes-in-binary-tree/description/?envType=study-plan-v2&envId=leetcode-75Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X.Return the number of good nodes in the binary tree. Example 1:Input: root = [3,1,4,3,null,1,5]Output: 4Explanation: Nodes in blue are good.Root No..


  5. [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..


  6. [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:..


  7. [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..


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

    보호되어 있는 글입니다.


  9. [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 ..


  10. [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..