原创 leetcode 1044. Longest Duplicate Substring
Given a string S, consider all duplicated substrings: (contiguous) substrings of S that occur 2 or more times. (The oc
原创 leetcode 1095. Find in Mountain Array
(This problem is an interactive problem.) You may recall that an array A is a mountain array if and only if: A.length >
原创 leetcode 568. Maximum Vacation Days
LeetCode wants to give one of its best employees the option to travel among N cities to collect algorithm problems. But
原创 leetcode 159. Longest Substring with At Most Two Distinct Characters
Given a string s , find the length of the longest substring t that contains at most 2 distinct characters. Example 1:
原创 leetcode 1088. Confusing Number II
We can rotate digits by 180 degrees to form new digits. When 0, 1, 6, 8, 9 are rotated 180 degrees, they become 0, 1, 9
原创 leetcode 982. Triples with Bitwise AND Equal To Zero
Given an array of integers A, find the number of triples of indices (i, j, k) such that: 0 <= i < A.length 0 <= j < A.l
原创 leeetcode 1001. Grid Illumination
On a N x N grid of cells, each cell (x, y) with 0 <= x < N and 0 <= y < N has a lamp. Initially, some number of lamps a
原创 leetcode 1106. Parsing A Boolean Expression
Return the result of evaluating a given boolean expression, represented as a string. An expression can either be: "t",
原创 leetcode 1157. Online Majority Element In Subarray
Implementing the class MajorityChecker, which has the following API: MajorityChecker(int[] arr) constructs an instance
原创 leetcode 772. Basic Calculator III
Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closi
原创 leetcode 1036. Escape a Large Maze
In a 1 million by 1 million grid, the coordinates of each grid square are (x, y) with 0 <= x, y < 10^6. We start at the
原创 leetcode 308. Range Sum Query 2D - Mutable
Given a 2D matrix matrix, find the sum of the elements inside the rectangle defined by its upper left corner (row1, col
原创 leetcode 210. Course Schedule II
There are a total of n courses you have to take, labeled from 0 to n-1. Some courses may have prerequisites, for exampl
原创 leetcode 906. Super Palindromes
Let's say a positive integer is a superpalindrome if it is a palindrome, and it is also the square of a palindrome. Now
原创 leetcode 1096. Brace Expansion II
Under a grammar given below, strings can represent a set of lowercase words. Let's use R(expr) to denote the set of wo