목록재귀 (30)
넘치게 채우기
https://school.programmers.co.kr/learn/courses/30/lessons/64064 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr프로그래머스 - 불량 사용자문제 유형 : 백트래킹, dfs문제 난이도 : Level 3 문제개발팀 내에서 이벤트 개발을 담당하고 있는 "무지"는 최근 진행된 카카오이모티콘 이벤트에 비정상적인 방법으로 당첨을 시도한 응모자들을 발견하였습니다. 이런 응모자들을 따로 모아 불량 사용자라는 이름으로 목록을 만들어서 당첨 처리 시 제외하도록 이벤트 당첨자 담당자인 "프로도" 에게 전달하려고 합니다. 이 때 개인..
https://leetcode.com/problems/balance-a-binary-search-tree/description/leetcode - Balance a Binary Search Tree문제 유형 : 트리, 재귀, 이진트리, 이진탐색트리문제 난이도 : Medium 문제Given the root of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them.A binary search tree is balanced if the depth of the two subtrees of every node never..
https://leetcode.com/problems/the-number-of-beautiful-subsets/description/leetcode - The Number of Beautiful Subsets문제 유형 : 백트래킹, dfs, 재귀문제 난이도 : Medium 문제You are given an array nums of positive integers and a positive integer k.A subset of nums is beautiful if it does not contain two integers with an absolute difference equal to k.Return the number of non-empty beautiful subsets of the array nu..
https://leetcode.com/problems/palindrome-partitioning/description/leetcode - Palindrome Partitioning문제 유형 : 문자열 처리, 재귀, dfs, 백트래킹문제 난이도 : Medium 문제Given a string s, partition s such that every substring of the partition is a palindrome. Return all possible palindrome partitioning of s. 문자열 s가 주어진다.모든 (s를 쪼갠 조각들이 팰린드롬 문자열)인 집합들을 반환하시오. ex-> "aab"는 ["a", "a", "b"]로 나누면 모두 팰린드롬인 문자열들로 나눈 것입니다. 풀이재귀..
https://leetcode.com/problems/subsets/description/leetcode - Subsets문제 유형 : dfs, 백트래킹, 재귀, 비트마스킹문제 난이도 : Medium 문제Given an integer array nums of unique elements, return all possible subsets (the power set).The solution set must not contain duplicate subsets. Return the solution in any order. 중복이 없는 요소들의 정수 배열 nums가 주어진다. 모든 부분집합을 만드시오.중복된 부분집합을 허용하지 않습니다.순서는 상관 없습니다. 풀이백트래킹 풀이 - 빈 배열부터 시작해서 이번 인..
https://leetcode.com/problems/distribute-coins-in-binary-tree/description/leetcode - Distribute Coins in Binary Tree문제 유형 : 이진트리, dfs, 재귀, 부분합문제 난이도 : Medium 문제You are given the root of a binary tree with n nodes where each node in the tree has node.val coins. There are n coins in total throughout the whole tree.In one move, we may choose two adjacent nodes and move one coin from one node to an..
https://leetcode.com/problems/delete-leaves-with-a-given-value/description/leetcode - Delete Leaves With a Given Value문제 유형 : 이진트리, dfs, 재귀문제 난이도 : Medium 문제Given a binary tree root and an integer target, delete all the leaf nodes with value target.Note that once you delete a leaf node with value target, if its parent node becomes a leaf node and has the value target, it should also be deleted (..
https://leetcode.com/problems/evaluate-boolean-binary-tree/description/leetcode - Evaluate Boolean Binary Tree문제 유형 : 이진트리, dfs, 재귀문제 난이도 : Easy 문제You are given the root of a full binary tree with the following properties:Leaf nodes have either the value 0 or 1, where 0 represents False and 1 represents True.Non-leaf nodes have either the value 2 or 3, where 2 represents the boolean OR and 3 rep..
https://leetcode.com/problems/path-with-maximum-gold/description/leetcode - Path with Maximum Gold문제 유형 : dfs, 백트래킹, 행렬, 재귀문제 난이도 : Medium 문제In a gold mine grid of size m x n, each cell in this mine has an integer representing the amount of gold in that cell, 0 if it is empty.Return the maximum amount of gold you can collect under the conditions:Every time you are located in a cell you will coll..
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를 받습니다.이 연결리스트는 양의 정수를 의미합니다.두 배 하시오. 풀이재귀적으로 ..