- Today
- Total
목록분류 전체보기 (384)
작심삼일
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/bL0bUx/btrzx9chspv/TKtFObuC015ESknh8NGOB0/img.jpg)
1. 1번방 오른쪽에 있는 선반에서 떡의 색대로 가운데 여자가 앉아있는 바둑판의 모양에 입력하면 녹차잎이 들어있는 통조림이 나온다. 2-1. 3번방의 오른쪽에 있는 벽의 오른쪽 선반을 열면 부채가 나온다. 이 부채들의 손잡이 위치를 외우자. (↗↙↖↘↙) 2-2. 그 순서대로 3번방 왼쪽 서랍장에 부채모양 서랍을 해결한다. 그럼 칼을 가는데 쓰는 숫돌이 나온다. 3-1. 2번방의 모닥불 옆에 방석인척 하고있는 과자를 열면 온천 모양의 무늬가 새겨진 과자가 나온다. 3-2. 4번방의 왼쪽 벽의 오른쪽 서랍에 그대로 입력하면 장기말이 들어있다. 4-1. 3번방의 오른쪽 벽의 왼쪽 서랍에 파란색 부채가 있고, 그 왼쪽 대나무들 옆에 노란색 부채가 있다. 4-2. 4번방의 왼쪽 노란 여행가방 옆에 초록 부채가 ..
문제 링크: https://leetcode.com/problems/trim-a-binary-search-tree/ 문제 Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, high]. Trimming the tree should not change the relative structure of the elements that will remain in the tree (i.e., any node's descendant should remain a descendant). It can be prove..
문제 링크: https://leetcode.com/problems/search-in-a-binary-search-tree/ 문제 You are given the root of a binary search tree (BST) and an integer val. Find the node in the BST that the node's value equals val and return the subtree rooted with that node. If such a node does not exist, return null. 조건 The number of nodes in the tree is in the range [1, 5000]. 1
문제 링크: https://leetcode.com/problems/spiral-matrix-ii/ 문제 Given a positive integer n, generate an n x n matrix filled with elements from 1 to $n^2$ in spiral order. 조건 1
문제 링크: https://leetcode.com/problems/shift-2d-grid/ 문제 Given a 2D grid of size m x n and an integer k. You need to shift the grid k times. In one shift operation: Element at grid[i][j] moves to grid[i][j + 1]. Element at grid[i][n - 1] moves to grid[i + 1][0]. Element at grid[m - 1][n - 1] moves to grid[0][0]. Return the 2D grid after applying shift operation k times. 조건 m == grid.length n == gr..
문제 링크: https://leetcode.com/problems/kth-largest-element-in-a-stream/ 문제 Design a class to find the $k^{th}$ largest element in a stream. Note that it is the $k^{th}$ largest element in the sorted order, not the $k^{th}$ distinct element. Implement KthLargest class: KthLargest(int k, int[] nums) Initializes the object with the integer k and the stream of integers nums. int add(int val) Appends t..
문제 링크: https://leetcode.com/problems/last-stone-weight/ 문제 You are given an array of integers stones where stones[i] is the weight of the ith stone. We are playing a game with the stones. On each turn, we choose the heaviest two stones and smash them together. Suppose the heaviest two stones have weights x and y with x
문제 링크: https://leetcode.com/problems/3sum-with-multiplicity/ 문제 Given an integer array arr, and an integer target, return the number of tuples i, j, k such that i < j < k and arr[i] + arr[j] + arr[k] == target. As the answer can be very large, return it modulo 109 + 7. 조건 3