Eat Study Love

먹고 공부하고 사랑하라

코린이 36

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

Next Greater Element I(Array,Hash Table,Stack,Monotonic Stack)

https://leetcode.com/problems/next-greater-element-i/description/The next greater element of some element x in an array is the first greater element that is to the right of x in the same array.You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2.For each 0  j such that nums1[i] == nums2[j] and determine the next greater element of nums2[j] in nums..

Coding_Practice 2024.12.03

코딩테스트 문제 4개 Review

C - 2개 / C++ - 2개 이렇게 총 4개의 코딩문제를 3시간에 거쳐서 풀어보았다. 문제는 Time / Space Complexcity를 크게 고려하지 않고, 정답만 도출되면 인정되는 부분이라 어거지로 코드를 짜서 답을 도출해내는 데에는 성공을 했으나.. 앞으로 좀 더 효율적인 코딩을 하기 위해선 Coding Review정도는 하고 넘어가는 것이 좋을 거 같아 글을 적어본다. 문제의 출처도 제공되진 않지만, 시험이 끝나고 내가 스스로 복기 + 구글링/GPT를 이용해서 문제 출처를 추려내어 보았다.  1번 문제https://school.programmers.co.kr/learn/courses/30/lessons/42627 프로그래머스SW개발자를 위한 평가, 교육, 채용까지 Total Solution을..

Coding_Practice 2024.12.02

Sort Characters By Frequency(Hash Table,String,Sorting,Heap (Priority Queue),Bucket Sort,Counting)

https://leetcode.com/problems/sort-characters-by-frequency/description/Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string.Return the sorted string. If there are multiple answers, return any of them. Example 1:Input: s = "tree"Output: "eert"Explanation: 'e' appears twice while 'r' and..

Coding_Practice 2024.11.18

Guess Number Higher or Lower II[Math,Dynamic Programming,Game Theory]

https://leetcode.com/problems/guess-number-higher-or-lower-ii/description/We are playing the Guessing Game. The game will work as follows:I pick a number between 1 and n.You guess a number.If you guess the right number, you win the game.If you guess the wrong number, then I will tell you whether the number I picked is higher or lower, and you will continue guessing.Every time you guess a wrong n..

Coding_Practice 2024.11.05