Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that sh…
分类:LeetCode
[LeetCode] Mini Parser 迷你解析器
Given a nested list of integers represented as a string, implement a parser to deserialize it. Each ele…
200. Number of Islands
Given a 2d grid map of ‘1’s (land) and ‘0’s (water), count the number of islands. An i…
Leetcode PHP题解--D10 942. DI String Match
942. DI String Match 题目链接 942. DI String Match 题目分析 给定一个只含I和D的字符串S,返回一个数组。 这个数组满足以下条件: 当S[i]为I时,A[i]<A[i+1]…
枚举——称硬币
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书 1. 枚举 枚举是基于逐个尝试答案的一种问题求解策略。 2. 称硬币(POJ1013) 问题描…
LeetCode算法题-Third Maximum Number(Java实现-四种解法)
这是悦乐书的第222次更新,第235篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第89题(顺位题号是414)。给定非空的整数数组,返回此数组中的第三个最大数字。如果不存在,则返回最大数量。…
Leetcode108——Convert Sorted Array to Binary Search Tree
文章作者:Tyan 博客:noahsnail.com | CSDN | 简书 1. 问题描述 Given an array where elements are sorte…
253. Meeting Rooms II
Medium /** * Definition for an interval. * public class Interval { * int start; * int end; * Interval() { star…
2018-05-16 190. Reverse Bits
题意:给你一个32位无符号数(uint32_t)n,将n的二进制数反转后以32位无符号格式返回。例如: Input: 43261596 Output: 964176192 Explanation: 43261596 re…
[LeetCode] Palindrome Partitioning II 拆分回文串之二
Given a string s, partition s such that every substring of the partition is a palindrome. Return the mi…
[LeetCode] Maximum XOR of Two Numbers in an Array 数组中异或值最大的两个数字
Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find th…
[LeetCode] Swap Adjacent in LR String 交换LR字符串中的相邻项
In a string composed of 'L', 'R', and 'X' characters, like "RXXLRXRXL", a move…