- Today
- Total
목록스터디/코테 (223)
작심삼일

문제 링크: https://leetcode.com/problems/mirror-reflection/ 문제 There is a special square room with mirrors on each of the four walls. Except for the southwest corner, there are receptors on each of the remaining corners, numbered 0, 1, and 2. The square room has walls of length p and a laser ray from the southwest corner first meets the east wall at a distance q from the 0th receptor. Given the two ..
문제 링크: https://leetcode.com/problems/my-calendar-i/ 문제 You are implementing a program to use as your calendar. We can add a new event if adding the event will not cause a double booking. A double booking happens when two events have some non-empty intersection (i.e., some moment is common to both events.). The event can be represented as a pair of integers start and end that represents a booking..
문제 링크: https://leetcode.com/problems/kth-smallest-element-in-a-sorted-matrix/ 문제 Given an n x n matrix where each of the rows and columns is sorted in ascending order, return the $k^{th}$ smallest element in the matrix. Note that it is the $k^{th}$ smallest element in the sorted order, not the $k^{th}$ distinct element. You must find a solution with a memory complexity better than O($n^2$). 조건 n..

문제 링크: https://leetcode.com/problems/unique-paths/ 문제 There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid[0][0]). The robot tries to move to the bottom-right corner (i.e., grid[m - 1][n - 1]). The robot can only move either down or right at any point in time. Given the two integers m and n, return the number of possible unique paths that the robot..
문제 링크: https://leetcode.com/problems/find-and-replace-pattern/ 문제 Given a list of strings words and a string pattern, return a list of words[i] that match pattern. You may return the answer in any order. A word matches the pattern if there exists a permutation of letters p so that after replacing every letter x in the pattern with p(x), we get the desired word. Recall that a permutation of lette..
문제 링크: https://leetcode.com/problems/valid-anagram/ 문제 Given two strings s and t, return true if t is an anagram of s, and false otherwise. An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once. 조건 1
문제 링크: https://leetcode.com/problems/flatten-binary-tree-to-linked-list/ 문제 Given the root of a binary tree, flatten the tree into a "linked list": The "linked list" should use the same TreeNode class where the right child pointer points to the next node in the list and the left child pointer is always null. The "linked list" should be in the same order as a pre-order traversal of the binary tre..
문제 링크: https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ 문제 Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself..