- Today
- Total
목록스터디 (246)
작심삼일
문제 링크: https://leetcode.com/problems/find-first-and-last-position-of-element-in-sorted-array/ 문제 Given an array of integers nums sorted in non-decreasing order, find the starting and ending position of a given target value. If target is not found in the array, return [-1, -1]. You must write an algorithm with O(log n) runtime complexity. 조건 $0$
문제 링크: https://leetcode.com/problems/partition-list/ 문제 Given the head of a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. Example 1: 조건 The number of nodes in the list is in the range [0, 200]. -100
문제 링크: https://leetcode.com/problems/pascals-triangle/ 문제 Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: 조건 1
문제 링크: https://leetcode.com/problems/max-area-of-island/ 문제 You are given an m x n binary matrix grid. An island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water. The area of an island is the number of cells with a value 1 in the island. Return the maximum area of an island in grid. If ther..
문제 링크: https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/ 문제 Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree. 조건 1
문제 링크: https://leetcode.com/problems/binary-tree-level-order-traversal/ 문제 Given the root of a binary tree, return the level order traversal of its nodes' values. (i.e., from left to right, level by level). 조건 The number of nodes in the tree is in the range [0, 2000]. -1000 List[List[int]]: if not root: return [] ans = [[]] def traversal(root, depth): if not root: return if len(ans) > depth: ans..
문제 링크: https://leetcode.com/problems/matchsticks-to-square/ 문제 You are given an integer array matchsticks where matchsticks[i] is the length of the ith matchstick. You want to use all the matchsticks to make one square. You should not break any stick, but you can link them up, and each matchstick must be used exactly one time. Return true if you can make this square and false otherwise. 조건 1 tar..
문제 링크: https://leetcode.com/problems/binary-tree-right-side-view/ 문제 Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. 조건 The number of nodes in the tree is in the range [0, 100]. -100