recursion3 [Leetcode 51] - N-Queens w/ Python The n-queens puzzle is the problem of placing n queens on an n x n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. You may return the answer in any order. Each solution contains a distinct board configuration of the n-queens' placement, where 'Q' and '.' both indicate a queen and an empty space, respectively. n x n크기.. 2024. 4. 16. [Leetcode 17] - Letter Combinations of a Phone Number w/ Python Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters. 전화기에 있는 숫자 조합이 주어졌을 경우 2~9의 각 숫자에 알맞은 글자로 만들수 있는 조합을 찾는 문제 https://leetcode.com/problems/letter-combinations-of-a-p.. 2024. 4. 15. [Leetcode 1448] - Count Good Nodes in Binary Tree w/ Python Given a binary tree root, a node X in the tree is named good if in the path from root to X there are no nodes with a value greater than X. Return the number of good nodes in the binary tree. 이진 트리가 주어졌을때 다음으로 탐색할 노드의 값이 현재 위치한 노드의 값보다 큰 숫자를 파악해서 리턴 ※ Root 노드는 언제나 포함된다 https://leetcode.com/problems/count-good-nodes-in-binary-tree/description/ Example 1: Input: root = [3,1,4,3,null,1,5] Output: 4 .. 2024. 4. 10. 이전 1 다음 반응형