这是悦乐书的第246次更新,第259篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第113题(顺位题号是501)。给定具有重复项的二叉搜索树(BST),找到给定BST中的所有模式(最常出现的…
分类:LeetCode
FB计算器加乘括号
加乘无括号 public static int simpleCaculator(String s){ if (s == null || s.length() == 0){ return 0; } int res = 0;…
606. Construct String from Binary Tree
You need to construct a string consists of parenthesis and integers from a binary tree with the preorder trave…
LeetCode刷题之Min Stack
Problem Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push…
236. Lowest Common Ancestor of a Binary Tree
236. Lowest Common Ancestor of a Binary Tree 题目 Given a binary tree, find the lowest common ancestor (LCA) of …
[LeetCode] Find Minimum in Rotated Sorted Array 寻找旋转有序数组的最小值
Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7&nb…
[LeetCode] Patching Array 补丁数组
Given a sorted positive integer array nums and an integer n, add/patch elements to the a…
[剑指offer] 滑动窗口的最大值
本文首发于我的个人博客:[尾尾部落](https://weiweiblog.cn/maxinwindows/) 题目描述 给定一个数组和滑动窗口的大小,找出所有滑动窗口里数值的最大值。例如,如果输入数组{2,3,4,2,…
[LeetCode] Maximal Rectangle 最大矩形
Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing all…
[LeetCode] Plus One Linked List 链表加一运算
Given a non-negative number represented as a singly linked list of digits, plus one to the number. The …
[LeetCode] Parse Lisp Expression 解析Lisp表达式
You are given a string expression representing a Lisp-like expression to return the integer v…
LeetCode | Permutation Sequence
题目: The set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all…