목록PS/LeetCode (618)
넘치게 채우기
https://leetcode.com/problems/find-the-count-of-good-integers/description/BOJ - Find the Count of Good Integers문제 유형: 조합론, 정수론, 수학, 브루트포스, 백트래킹, 비트마스킹문제 난이도: Hard 문제You are given two positive integers n and k.An integer x is called k-palindromic if:x is a palindrome.x is divisible by k.An integer is called good if its digits can be rearranged to form a k-palindromic integer. For example, for k =..
https://leetcode.com/problems/put-marbles-in-bags/description/?envType=daily-question&envId=2025-03-31leetcode - Put Marbles in Bags문제 유형: 그리디, 정렬, 구현문제 난이도: Hard 문제You have k bags. You are given a 0-indexed integer array weights where weights[i] is the weight of the ith marble. You are also given the integer k.Divide the marbles into the k bags according to the following rules:No bag is empty.I..
https://leetcode.com/problems/apply-operations-to-maximize-score/description/leetcode - Apply Operations to Maximize Score문제 유형: 모노토닉 스택, 스택, 그리디, 정수론, 정렬문제 난이도: Hard 문제You are given an array nums of n positive integers and an integer k.Initially, you start with a score of 1. You have to maximize your score by applying the following operation at most k times:Choose any non-empty subarray nums[l,..
https://leetcode.com/problems/maximum-number-of-points-from-grid-queries/description/leetcode - Maximum Number of Points From Grid Queries문제 유형: 우선순위 큐, bfs, 그리디문제 난이도: Hard 원래 LeetCode문제를 leetcode solution탭에만 올리고 티스토리에 더 이상 안올리려 했는데..앞으로 인상깊은 문제만 올리려합니다 문제 You are given an m x n integer matrix grid and an array queries of size k.Find an array answer of size k such that for each integer queries[..
https://leetcode.com/problems/construct-binary-tree-from-preorder-and-postorder-traversal/description/leetcode - Construct Binary Tree from Preorder and Postorder Traversal문제 유형: 트리, 분할 정복문제 난이도: Medium 문제Given two integer arrays, preorder and postorder where preorder is the preorder traversal of a binary tree of distinct values and postorder is the postorder traversal of the same tree, reconstr..
https://leetcode.com/problems/recover-a-tree-from-preorder-traversal/description/leetcode - Recover a Tree From Preorder Traversal문제 유형: 스택, 트리, dfs, 문자열 처리문제 난이도: Hard 문제We run a preorder depth-first search (DFS) on the root of a binary tree.At each node in this traversal, we output D dashes (where D is the depth of this node), then we output the value of this node. If the depth of a node is D..
https://leetcode.com/problems/find-elements-in-a-contaminated-binary-tree/description/?envType=daily-question&envId=2025-02-21leetcode - Find Elements in a Contaminated Binary Tree문제 유형: 트리, 해시문제 난이도: Medium 문제Given a binary tree with the following rules:root.val == 0For any treeNode:If treeNode.val has a value x and treeNode.left != null, then treeNode.left.val == 2 * x + 1If treeNode.val has a..
https://leetcode.com/problems/the-k-th-lexicographical-string-of-all-happy-strings-of-length-n/description/leetcode - The k-th Lexicographical String of All Happy Strings of Length n문제 유형: 백트래킹, 수학, 조합론, 해 구성하기문제 난이도: Medium 문제A happy string is a string that:consists only of letters of the set ['a', 'b', 'c'].s[i] != s[i + 1] for all values of i from 1 to s.length - 1 (string is 1-indexed).For e..
https://leetcode.com/problems/construct-smallest-number-from-di-string/description/leetcode - Construct Smallest Number From DI String문제 유형: 백트래킹, 비트마스킹, 문자열 처리, 그리디문제 난이도: Medium 문제You are given a 0-indexed string pattern of length n consisting of the characters 'I' meaning increasing and 'D' meaning decreasing.A 0-indexed string num of length n + 1 is created using the following conditions:num..
https://leetcode.com/problems/letter-tile-possibilities/description/leetcode - Letter Tile Possibilities문제 유형: 백트래킹문제 난이도: Medium 문제You have n tiles, where each tile has one letter tiles[i] printed on it.Return the number of possible non-empty sequences of letters you can make using the letters printed on those tiles. n개의 타일이 주어지고, tiles[i]에 한 글자가 있다.모든 가능한 글자들의 길이가 1 이상인 순열들을 구하시오. 풀이백트래킹을 이용해..