Eat Study Love

먹고 공부하고 사랑하라

leetcode 14

Minesweeper[Array,Depth-First Search,Breadth-First Search,Matrix]

https://leetcode.com/problems/minesweeper/description/Let's play the minesweeper game (Wikipedia, online game)!You are given an m x n char matrix board representing the game board where:'M' represents an unrevealed mine,'E' represents an unrevealed empty square,'B' represents a revealed blank square that has no adjacent mines (i.e., above, below, left, right, and all 4 diagonals),digit ('1' to '..

Coding_Practice 2024.12.04

Largest Number(Array,String,Greedy,Sorting)

https://leetcode.com/problems/largest-number/description/Given a list of non-negative integers nums, arrange them such that they form the largest number and return it.Since the result may be very large, so you need to return a string instead of an integer. Example 1:Input: nums = [10,2]Output: "210"Example 2:Input: nums = [3,30,34,5,9]Output: "9534330" Constraints:1 0 문제 자체는 일단 설명이 짧아서 좋다. 한 번 D..

Coding_Practice 2024.11.20

Maximum Depth of N-ary Tree[Tree,Depth-First Search,Breadth-First Search]

https://leetcode.com/problems/maximum-depth-of-n-ary-tree/description/?envType=problem-list-v2&envId=treeGiven a n-ary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Nary-Tree input serialization is represented in their level order traversal, each group of children is separated by the null value (See ..

Coding_Practice 2024.10.29

My Calendar II[Array,Binary Search,Design,Segment Tree,Prefix Sum,Ordered Set]

https://leetcode.com/problems/my-calendar-ii/description/You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a triple booking.A triple booking happens when three events have some non-empty intersection (i.e., some moment is common to all the three events.).The event can be represented as a pair of integers start and end that represent..

Coding_Practice 2024.10.24

Search a 2D Matrix II[M,Array,Binary Search,Divide and Conquer,Matrix]

https://leetcode.com/problems/search-a-2d-matrix-ii/description/Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integers in each column are sorted in ascending from top to bottom. Example 1:Input: matrix = [[1,4,7,11,15],[2,5,8,12,19],[3,6,9,16..

Coding_Practice 2024.10.16

Same Tree[E,Tree,Depth-First Search,Breadth-First Search,Binary Tree]

https://leetcode.com/problems/same-tree/description/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 same value. Example 1:Input: p = [1,2,3], q = [1,2,3]Output: trueExample 2:Input: p = [1,2], q = [1,null,2]Output: falseExample 3:Input: p = [1,2,1..

Coding_Practice 2024.08.22