Shilei Tian

Waiting Persistent Accumulation Surpass

[Leetcode 494] Target Sum

题目要求You are given a list of non-negative integers, a1, a2, …, an, and a target, S. Now you have 2 symbols + and -. For each integer, you should choo..


[Leetcode 486] Predict the Winner

题目要求Given an array of scores that are non-negative integers. Player 1 picks one of the numbers from either end of the array followed by the player 2..


[Leetcode 496] Next Greater Element I

题目要求You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for ..


[Leetcode 398] Random Pick Index

题目要求Given an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target nu..


[Leetcode 201] Bitwise AND of Numbers Range

题目要求Given a range [m, n] where $0 \leq m \leq n \leq 2147483647$, return the bitwise AND of all numbers in this range, inclusive. For example, given..


[Leetcode 212] Word Search II

题目要求Given a 2D board and a list of words from the dictionary, find all words in the board. Each word must be constructed from letters of sequentiall..


[Leetcode 424] Longest Repeating Character Replacement

题目要求Given a string that consists of only uppercase English letters, you can replace any letter in the string with another letter at most k times. Fi..


[Leetcode 312] Burst Balloons

题目要求Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the b..


[Leetcode 421] Maximum XOR of Two Numbers in an Array

题目要求Given a non-empty array of numbers, $a_{0},a_{1},a_{2},\dots,a_{n-1}$, where $0 \leq a_i<2^{31}$. Find the maximum result of $a_i\oplus a_j$,..


[Leetcode 423] Reconstruct Original Digits from English

题目要求Given a non-empty string containing an out-of-order English representation of digits 0-9, output the digits in ascending order. Note: Input con..