Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < versio…
分类:LeetCode
[LeetCode] Binary Tree Longest Consecutive Sequence 二叉树最长连续序列
Given a binary tree, find the length of the longest consecutive sequence path. The path refers t…
[LeetCode] Nested List Weight Sum 嵌套链表权重和
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. Ea…
LeetCode 242 Valid Anagram
题目描述 Given two strings s and t, write a function to determine if t is an anagram of s. For example, s = “anagr…
229. Majority Element II
Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times.Note: The algorithm sh…
LeetCode | Longest Consecutive Sequence(最长连续序列)
Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example…
LeetCode | Largest Rectangle in Histogram(直方图围城的最大矩形面积)
Given n non-negative integers representing the histogram’s bar height where the width of each …
LeetCode算法题-Guess Number Higher or Lower(Java实现)
这是悦乐书的第211次更新,第224篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第79题(顺位题号是374)。我们正在玩数字游戏。 游戏如下:我从1到n中选择一个数字。 你必须猜测我选择了…
23.Merge k Sorted Lists
Hard 这个题 我一开始没想到用Priority Queue, 想的是每次遍历整个lists找最小的来接上。其实思路本质上是一样的,但太麻烦而且说明你对priority queue不熟。吓得我赶紧做implement …
103. Binary Tree Zigzag Level Order Traversal
欢迎fork and star:Nowcoder-Repository-github 103. Binary Tree Zigzag Level Order Traversal 题目 Given a binary tre…
104. Maximum Depth of Binary Tree
104. Maximum Depth of Binary Tree 题目 Given a binary tree, find its maximum depth. The maximum depth is the num…
[LeetCode] Evaluate Division 求除法表达式的值
Equations are given in the format A / B = k, where A and B are variables repre…