Given a non-empty binary tree, return the average value of the nodes on each level in the form of an ar…
分类:LeetCode
[LeetCode] Valid Tic-Tac-Toe State 验证井字棋状态
A Tic-Tac-Toe board is given as a string array board. Return True if and only if it is possible to…
LeetCode | Reverse Nodes in k-Group
题目: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list…
LeetCode 236 Lowest Common Ancestor of a Binary Tree
题目描述 Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to t…
216. Combination Sum III
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can…
LeetCode | Roman to Integer(罗马数字转换成整数)
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 题目…
[LeetCode] Maximum Depth of Binary Tree
链接:https://leetcode.com/submissions/detail/136407355/ 难度:Easy 题目:104. Maximum Depth of Binary Tree Given a bin…
LeetCode算法题-To Lower Case(Java实现)
这是悦乐书的第301次更新,第320篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第169题(顺位题号是709)。实现具有字符串参数str的函数ToLowerCase():以小写形式返回相同…
2018-06-20 108. Convert Sorted Array to Binary Search Tree
题意:给你一个已排序的vector,要求吧vector转换成二叉搜索树,且该二叉搜索树是高度平衡树。 解题思路:使用递归的办法,中间的数就是根节点,左边的一半组成左子树,右边的一半组成右子树,然后对左半vector和右半…
404. Sum of Left Leaves
My Submissions Total Accepted: 11811 Total Submissions: 25597 Difficulty: Easy Contributors: Admin Find the su…
[LeetCode By Go 57]268. Missing Number
题目 Given an array containing n distinct numbers taken from 0, 1, 2, …, n, find the one that is missing f…
【LeetCode】字符串低级算法-考证回文字符串
问题形貌 考证回文字符串给定一个字符串,考证它是不是是回文串,只斟酌字母和数字字符,能够疏忽字母的大小写。 申明:本题中,我们将空字符串定义为有用的回文串。 示例 1: 输入: "A man, a plan, a can…