목록LeetCode (569)
넘치게 채우기
https://leetcode.com/problems/longest-strictly-increasing-or-strictly-decreasing-subarray/description/leetcode - Longest Strictly Increasing or Strictly Decreasing Subarray문제 유형: 슬라이딩 윈도우문제 난이도: Easy 문제You are given an array of integers nums. Return the length of the longest subarray of nums which is either strictly increasing or strictly decreasing. 정수 배열 nums가 주어진다. 가장 긴 오름차순 또는 내림차순 부분배열의 길이를..
https://leetcode.com/problems/check-if-array-is-sorted-and-rotated/description/leetcode - Check if Array Is Sorted and Rotated문제 유형: 배열, 구현문제 난이도: Easy 문제Given an array nums, return true if the array was originally sorted in non-decreasing order, then rotated some number of positions (including zero). Otherwise, return false.There may be duplicates in the original array.Note: An array A rotated ..
https://leetcode.com/problems/special-array-i/description/leetcode - Special Array I문제 유형: 구현문제 난이도: Easy 문제An array is considered special if every pair of its adjacent elements contains two numbers with different parity.You are given an array of integers nums. Return true if nums is a special array, otherwise, return false. 배열의 모든 인접한 쌍들의 홀짝이 다르면 특별한 배열이다. 특별한지 아닌지 확인하시오. 풀이i번과 i+1번의 홀짝여부가 한 번이..
https://leetcode.com/problems/making-a-large-island/description/leetcode - Making A Large Island문제 유형: BFS, 유니온-파인드, 그래프문제 난이도: Hard 문제You are given an n x n binary matrix grid. You are allowed to change at most one 0 to be 1.Return the size of the largest island in grid after applying this operation.An island is a 4-directionally connected group of 1s. n x n의 바이너리 행렬 grid가 주어진다. 최대 하나의 0을 1로 바꿀..
https://leetcode.com/problems/divide-nodes-into-the-maximum-number-of-groups/description/leetcode - Divide Nodes Into the Maximum Number of Groups문제 유형: bfs, 그래프, 연결 컴포넌트, 이분 그래프문제 난이도: Hard 문제You are given a positive integer n representing the number of nodes in an undirected graph. The nodes are labeled from 1 to n.You are also given a 2D integer array edges, where edges[i] = [ai, bi] indicate..
https://leetcode.com/problems/maximum-number-of-fish-in-a-grid/description/leetcode - Maximum Number fof Fish in a Grid문제 유형: bfs/dfs문제 난이도: Medium 문제You are given a 0-indexed 2D matrix grid of size m x n, where (r, c) represents:A land cell if grid[r][c] = 0, orA water cell containing grid[r][c] fish, if grid[r][c] > 0.A fisher can start at any water cell (r, c) and can do the following operati..
https://leetcode.com/problems/course-schedule-iv/description/leetcode - Course Schedule IV문제 유형: 그래프, 위상 정렬, 플로이드 위셜, 최단 거리문제 난이도: Medium 문제There are a total of numCourses courses you have to take, labeled from 0 to numCourses - 1. You are given an array prerequisites where prerequisites[i] = [ai, bi] indicates that you must take course ai first if you want to take course bi.For example, the pai..
https://leetcode.com/problems/maximum-employees-to-be-invited-to-a-meeting/description/leetcode -Maximum Employees to Be Invited to a Meeting문제 유형: 위상 정렬, bfs, 연결 컴포넌트, 그래프문제 난이도: Hard 문제A company is organizing a meeting and has a list of n employees, waiting to be invited. They have arranged for a large circular table, capable of seating any number of employees.The employees are numbered from 0..
https://leetcode.com/problems/make-lexicographically-smallest-array-by-swapping-elements/description/leetcode - Make Lexicographically Smallest Array by Swapping Elements문제 유형: 우선순위큐, 유니온-파인드문제 난이도: Medium 문제You are given a 0-indexed array of positive integers nums and a positive integer limit.In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] - num..
https://leetcode.com/problems/find-eventual-safe-states/description/leetcode - Find Eventual Safe States문제 유형: dfs, 위상 정렬문제 난이도: Medium 문제There is a directed graph of n nodes with each node labeled from 0 to n - 1. The graph is represented by a 0-indexed 2D integer array graph where graph[i] is an integer array of nodes adjacent to node i, meaning there is an edge from node i to each node in gra..