Eat Study Love

먹고 공부하고 사랑하라

Coding_Practice 170

Binary Tree Postorder Traversal[Stack,Tree,Depth-First Search,Binary Tree]

https://leetcode.com/problems/binary-tree-postorder-traversal/?envType=daily-question&envId=2024-09-04Given the root of a binary tree, return the postorder traversal of its nodes' values. Example 1:Input: root = [1,null,2,3]Output: [3,2,1]Explanation:Example 2:Input: root = [1,2,3,4,5,null,8,null,null,6,7,9]Output: [4,6,7,5,2,9,8,3,1]Explanation:Example 3:Input: root = []Output: []Example 4:Inpu..

Coding_Practice 2024.09.04

Sum of Digits of String After Convert[E,String,Simulation]

https://leetcode.com/problems/sum-of-digits-of-string-after-convert/description/?envType=daily-question&envId=2024-09-03You are given a string s consisting of lowercase English letters, and an integer k.First, convert s into an integer by replacing each letter with its position in the alphabet (i.e., replace 'a' with 1, 'b' with 2, ..., 'z' with 26). Then, transform the integer by replacing it w..

Coding_Practice 2024.09.03

Merge Two Binary Trees[E,TreeDepth-First Search,Breadth-First Search,Binary Tree]

https://leetcode.com/problems/merge-two-binary-trees/description/You are given two binary trees root1 and root2.Imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You need to merge the two trees into a new binary tree. The merge rule is that if two nodes overlap, then sum node values up as the new value of the merged nod..

Coding_Practice 2024.09.02

Find the Student that Will Replace the Chalk[M,Array,Binary Search,Simulation,Prefix Sum]

https://leetcode.com/problems/find-the-student-that-will-replace-the-chalk/description/?envType=daily-question&envId=2024-09-02There are n students in a class numbered from 0 to n - 1. The teacher will give each student a problem starting with the student number 0, then the student number 1, and so on until the teacher reaches the student number n - 1. After that, the teacher will restart the pr..

Coding_Practice 2024.09.02

Add One Row to Tree[M,Tree,Depth-First Search,Breadth-First Search,Binary Tree]

https://leetcode.com/problems/add-one-row-to-tree/?envType=daily-question&envId=2024-08-23Given the root of a binary tree and two integers val and depth, add a row of nodes with value val at the given depth depth.Note that the root node is at depth 1.The adding rule is:Given the integer depth, for each not null tree node cur at the depth depth - 1, create two tree nodes with value val as cur's l..

Coding_Practice 2024.08.23

Maximum Width of Binary Tree[M,Tree,Depth-First Search,Breadth-First Search,Binary Tree]

https://leetcode.com/problems/maximum-width-of-binary-tree/description/Given the root of a binary tree, return the maximum width of the given tree.The maximum width of a tree is the maximum width among all levels.The width of one level is defined as the length between the end-nodes (the leftmost and rightmost non-null nodes), where the null nodes between the end-nodes that would be present in a ..

Coding_Practice 2024.08.22