LeetCode

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. ...
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 ...
LeetCode

【LeetCode】2351. First Letter to Appear Twice 解答・解説【Python】

問題 原文 Given a string s consisting of lowercase English letters, return the first letter to appear twice. Note: ...
LeetCode

【LeetCode】300. Longest Increasing Subsequence 解答・解説【Python】

問題 原文 Given an integer array nums, return the length of the longest strictly increasing  subsequence . ...
LeetCode

【LeetCode】45. Jump Game II 解答・解説【Python】

問題 原文 You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums. Each el...
LeetCode

【LeetCode】55. Jump Game 解答・解説【Python】

問題 原文 You are given an integer array nums. You are initially positioned at the array's first index, and each element...
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...
LeetCode

【LeetCode】40. Combination Sum II 解答・解説【Python】

問題 原文 Given a collection of candidate numbers (candidates) and a target number (target), find all unique combination...
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...
LeetCode

【LeetCode】986. Interval List Intersections 解答・解説【Python】

問題 原文 You are given two lists of closed intervals, firstList and secondList, where firstList =  and secondLi...