LeetCode 【LeetCode】404. Sum of Left Leaves 解答・解説【Python】 問題 原文 Given the root of a binary tree, return the sum of all left leaves. A leaf is a node with no children. A le... 2023.05.08 LeetCodePythonアルゴリズム幅優先探索
LeetCode 【LeetCode】202. Happy Number 解答・解説【Python】 問題 原文 Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following... 2023.05.06 LeetCodePythonアルゴリズム
LeetCode 【LeetCode】637. Average of Levels in Binary Tree 解答・解説【Python】 問題 原文 Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. ... 2023.05.05 LeetCodePythonアルゴリズム幅優先探索
LeetCode 【LeetCode】107. Binary Tree Level Order Traversal II 解答・解説【Python】 問題 原文 Given the root of a binary tree, return the bottom-up level order traversal of its nodes' values. (i.e., from ... 2023.05.05 LeetCodePythonアルゴリズム幅優先探索
LeetCode 【LeetCode】300. Longest Increasing Subsequence 解答・解説【Python】 問題 原文 Given an integer array nums, return the length of the longest strictly increasing subsequence . ... 2023.05.04 LeetCodePythonアルゴリズム二分探索動的計画法
Python 【LeetCode】413. Arithmetic Slices 解答・解説【Python】 問題 原文 An integer array is called arithmetic if it consists of at least three elements and if the difference between ... 2023.05.03 Pythonアルゴリズム動的計画法
Python 【LeetCode】62. Unique Paths 解答・解説【Python】 問題 原文 There is a robot on an m x n grid. The robot is initially located at the top-left corner (i.e., grid). The rob... 2023.05.03 Pythonアルゴリズムメモ化再帰動的計画法
LeetCode 【LeetCode】17. Letter Combinations of a Phone Number 解答・解説【Python】 問題 原文 Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number c... 2023.04.30 LeetCodePythonアルゴリズムバックトラッキング
LeetCode 【LeetCode】40. Combination Sum II 解答・解説【Python】 問題 原文 Given a collection of candidate numbers (candidates) and a target number (target), find all unique combination... 2023.04.30 LeetCodePythonアルゴリズムバックトラッキング深さ優先探索
LeetCode 【LeetCode】200. Number of Islands 解答・解説【Python】 問題 原文 Given an m x n 2D binary grid grid which represents a map of '1's (land) and '0's (water), return the numb... 2023.04.23 LeetCodePythonアルゴリズム深さ優先探索