⭐️ 난이도 Gold 5 ⭐️ 문제 https://www.acmicpc.net/problem/6593 6593번: 상범 빌딩 당신은 상범 빌딩에 갇히고 말았다. 여기서 탈출하는 가장 빠른 길은 무엇일까? 상범 빌딩은 각 변의 길이가 1인 정육면체(단위 정육면체)로 이루어져있다. 각 정육면체는 금으로 이루어져 있어 www.acmicpc.net ⭐️ Idea flow 일반적인 BFS 문제에 z축이 추가된 문제였다. [전체적인 알고리즘] 1. 빌딩의 층 수, 가로, 세로의 길이를 받는다. 2. 빌딩의 대한 정보를 받으면서 'S'를 입력 받으면 queue에 push 한다. 3. BFS를 실행하면서 비어있는 곳을 다음 방문 위치로 선정한다. 방문한 현재의 위치는 '.'(빈 칸)에서 'x'(방문)으로 바꿔주어 방문..
전체 글
안녕하세요 :) 공부하며 배운 것들을 기록하기 위한 블로그입니다. 도움이 되시길 바라며 혹시 잘못된 점이 있다면 댓글 부탁드립니다! :D⭐️ 난이도 Medium ⭐️ 문제 https://leetcode.com/problems/house-robber-ii/ House Robber II - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 당신은 거리에 있는 집들을 따라서 도둑질 할 계획을 세우고 있는 프로 도둑이다. 각 집마다 일정한 양의 돈이 있다. 모든 집은 원의 형태를 띄고 있다. 즉, 첫 번째 집의 이웃은 마지막 집이다. 인접한 집에는 모두 경비 시스템이 연결되어 있는데, 만일 인접한 두 집이..
⭐️ 난이도 Easy ⭐️ 문제 https://leetcode.com/problems/climbing-stairs/ Climbing Stairs - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com You are climbing a staircase. It takes n steps to reach the top. 당신은 계단을 오르고 있다. 계단을 모두 오르기까지는 총 n개의 계단을 올라야 한다. Each time you can either climb 1 or 2 ..
⭐️ 난이도 Gold 5 ⭐️ 문제 https://www.acmicpc.net/problem/15591 15591번: MooTube (Silver) 농부 존은 1번 동영상과 2번 동영상이 USADO 3을 가지고, 2번 동영상과 3번 동영상이 USADO 2를 가지고, 2번 동영상과 4번 동영상이 USADO 4를 가진다고 했다. 이것에 기반해서 1번 동영상과 3번 동영상의 www.acmicpc.net 여태 다른 그래프 문제들과는 다르게 USADO라는 단어를 통해 문제를 설명해서, 얼핏 보면 어마무시해보이는 문제였다. 문제를 읽고 정리를 해보자. 1) 1~n까지 번호가 붙어있는 n개의 동영상이 있다. 2) 1~n개의 영상들 중에 n-1개의 가중치가 있는 간선이 있다. 3) USADO란 어떤 두 개의 영상에 있..
⭐️ 난이도 Medium ⭐️ 문제 https://leetcode.com/problems/validate-binary-search-tree/ Validate Binary Search Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given the root of a binary tree, determine if it is a valid binary search tree (BST). 이진 트리의 루트가 주어졌을 때, 그것이 유효한 BST인지 검사하시오...

⭐️ 난이도 Easy ⭐️ 문제 https://leetcode.com/problems/same-tree/ Same Tree - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Given the roots of two binary trees p and q, write a function to check if they are the same or not. binary tree 두개 p와 q의 root가 주어졌을 때, 두 개의 트리가 서로 같은지 아닌지 여부를 확인하는..