⭐️ 난이도 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 당신은 거리에 있는 집들을 따라서 도둑질 할 계획을 세우고 있는 프로 도둑이다. 각 집마다 일정한 양의 돈이 있다. 모든 집은 원의 형태를 띄고 있다. 즉, 첫 번째 집의 이웃은 마지막 집이다. 인접한 집에는 모두 경비 시스템이 연결되어 있는데, 만일 인접한 두 집이..
Coding test
⭐️ 난이도 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인지 검사하시오...
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2Fby9Pp2%2FbtrgVRlHGM8%2FNclfQrEFYKeB5dwKrw1YX0%2Fimg.png)
⭐️ 난이도 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가 주어졌을 때, 두 개의 트리가 서로 같은지 아닌지 여부를 확인하는..
⭐️ 난이도 Silver 1 ⭐️ 문제 https://www.acmicpc.net/problem/9205 9205번: 맥주 마시면서 걸어가기 송도에 사는 상근이와 친구들은 송도에서 열리는 펜타포트 락 페스티벌에 가려고 한다. 올해는 맥주를 마시면서 걸어가기로 했다. 출발은 상근이네 집에서 하고, 맥주 한 박스를 들고 출발한다. www.acmicpc.net ⭐️ Idea flow 이 문제에서는 간선이 주어지지 않았다. 직접 계산해서 추가를 해야 한다. 집, 편의점, 페스티벌의 위치가 주어지기 때문에, 각 지점에서 다른 지점까지의 거리가 맥주 20병으로 갈 수 있는 거리인지 확인한다. 만일 맥주 20병으로 갈 수 있는 거리라면(50m * 20병 = 1000m) 간선 정보에 추가해준다. 간선을 추가했다면 그 ..