Print Binary Tree 按照要求输出二叉树在对应二维数组种的值 /** * Definition for a binary tree node. * public class TreeNode { * pub…
分类:LeetCode
Advent of Code Day 8 注册表爱好者
解题语言不限Java Advent of Code Day 1 逆向验证码 Advent of Code Day 2 损坏校验和 Advent of Code Day 3 螺旋内存 Advent of Code Day …
尺取法
尺取法 尺取法核心思路 尺取法其实也是一种模拟,是解决寻找区间和问题的一种方法。 假如有这么一个问题:给你一些数,请在这些数中找到一个区间,使得区间里每一个元素的和大于或等于给定的某个值。 不会尺取法的话,肯定就会开双重…
Leetcode 158. Read N Characters Given Read4 II - Call multiple times
The API: int read4(char *buf) reads 4 characters at a time from a file. The return value is the actual number …
[LeetCode By Go 97]441. Arranging Coins
题目 You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exac…
[LeetCode] Frog Jump 青蛙过河
A frog is crossing a river. The river is divided into x units and at each unit there may or may not exi…
201. Bitwise AND of Numbers Range
Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this r…
[Leetcode] Repeated Substring Pattern 重复子串格式
Repeated Substring Pattern Given a non-empty string check if it can be constructed by taking a substring of it…
326. 3的幂
一、题目原型: 给定一个整数,写一个函数来判断它是否是 3 的幂次方。 二、示例剖析: 输入: 27 输出: true 输入: 0 输出: false 输入: 9 输出: true 输入: 45 输出: false 三、…
71. 简化路径-leetcode简化Unix路径算法的Java实现
我的LeetCode评论: https://leetcode-cn.com/problems/simplify-path/comments/31264 我的GitHub代码地址: https://github.com/g…
[LeetCode] Power of Two 判断2的次方数, Grey Code,Reverse Bits,Bitwise AND of Numbers Range,Number of 1 Bits,Divide Two Integers
Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: tr…
215. Kth Largest Element in an Array
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order…