목록PS/LeetCode (586)
넘치게 채우기
https://leetcode.com/problems/score-after-flipping-matrix/description/leetcode - Score After Flipping Matrix문제 유형 : 행렬, 비트마스킹, 그리디문제 난이도 : Medium 문제You are given an m x n binary matrix grid.A move consists of choosing any row or column and toggling each value in that row or column (i.e., changing all 0's to 1's, and all 1's to 0's).Every row of the matrix is interpreted as a binary number, and t..
https://leetcode.com/problems/largest-local-values-in-a-matrix/description/leetcode - Largest Local Values in a Matrix문제 유형 : 행렬, 구현문제 난이도 : Easy 문제You are given an n x n integer matrix grid.Generate an integer matrix maxLocal of size (n - 2) x (n - 2) such that:maxLocal[i][j] is equal to the largest value of the 3 x 3 matrix in grid centered around row i + 1 and column j + 1.In other words, we ..
https://leetcode.com/problems/minimum-cost-to-hire-k-workers/description/leetcode - Minimum Cost to Hire K Workers문제 유형 : 우선순위 큐, 정렬문제 난이도 : Hard 문제There are n workers. You are given two integer arrays quality and wage where quality[i] is the quality of the ith worker and wage[i] is the minimum wage expectation for the ith worker.We want to hire exactly k workers to form a paid group. To hire a ..
https://leetcode.com/problems/k-th-smallest-prime-fraction/description/leetcode - K-th Smallest Prime Fraction문제 유형 : 이진탐색, 브루트 포스문제 난이도 : Medium 문제You are given a sorted integer array arr containing 1 and prime numbers, where all the integers of arr are unique. You are also given an integer k.For every i and j where 0 arr[i] / arr[j].Return the kth smallest fraction considered. Return your ans..
https://leetcode.com/problems/maximize-happiness-of-selected-children/description/leetcode - Maximize Happiness of Selected Children문제 유형 : 정렬 / 그리디문제 난이도 : Medium 문제You are given an array happiness of length n, and a positive integer k.There are n children standing in a queue, where the ith child has happiness value happiness[i]. You want to select k children from these n children in k turns.In..
https://leetcode.com/problems/relative-ranks/description/leetcode - Relative Ranks문제 유형 : 우선순위 큐문제 난이도 : Easy 문제You are given an integer array score of size n, where score[i] is the score of the ith athlete in a competition. All the scores are guaranteed to be unique.The athletes are placed based on their scores, where the 1st place athlete has the highest score, the 2nd place athlete has the 2n..
https://leetcode.com/problems/double-a-number-represented-as-a-linked-list/description/leetcode - Double a Number Represented as a Linked List문제 유형 : 연결 리스트, 재귀문제 난이도 : Medium 문제You are given the head of a non-empty linked list representing a non-negative integer without leading zeroes.Return the head of the linked list after doubling it. 연결리스트의 Head를 받습니다.이 연결리스트는 양의 정수를 의미합니다.두 배 하시오. 풀이재귀적으로 ..
https://leetcode.com/problems/remove-nodes-from-linked-list/description/leetcode - Remove Nodes From Linked List문제 유형 : 연결 리스트, 재귀, 스택문제 난이도 : Medium 문제You are given the head of a linked list.Remove every node which has a node with a greater value anywhere to the right side of it.Return the head of the modified linked list. 연결리스트의 head가 주어진다.노드의 다음 노드들 중 더 큰 값이 있다면, 그 노드를 삭제하라.모든 작업이 끝나고 나서의 연결 ..
https://leetcode.com/problems/delete-node-in-a-linked-list/description/leetcode - Delete Node in a Linked List문제 유형 : 연결리스트문제 난이도 : Medium 문제There is a singly-linked list head and we want to delete a node node in it.You are given the node to be deleted node. You will not be given access to the first node of head.All the values of the linked list are unique, and it is guaranteed that the given no..
https://leetcode.com/problems/boats-to-save-people/description/leetcode - Boats to Save People문제 유형 : 정렬, 그리디, 투 포인터문제 난이도 : Medium 문제You are given an array people where people[i] is the weight of the ith person, and an infinite number of boats where each boat can carry a maximum weight of limit. Each boat carries at most two people at the same time, provided the sum of the weight of those peopl..