原创 leetcode453. Minimum Moves to Equal Array Elements

題目要求 Given a non-empty integer array of size n, find the minimum number of moves required to make all array elements equ

原创 leetcode363. Max Sum of Rectangle No Larger Than K

題目要求 Given a non-empty 2D matrix matrix and an integer k, find the max sum of a rectangle in the matrix such that its su

原创 leetcode438. Find All Anagrams in a String

題目要求 Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lo

原创 leetcode384. Shuffle an Array

題目要求 Shuffle a set of numbers without duplicates. Example: // Init an array with set 1, 2, and 3. int[] nums = {1,2,3}

原创 leetcode417. Pacific Atlantic Water Flow

題目要求 Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacif

原创 leetcode450. Delete Node in a BST

題目要求 Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node

原创 leetcode441. Arranging Coins

題目要求 You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k co

原创 leetcode410. Split Array Largest Sum

題目要求 Given an array which consists of non-negative integers and an integer m, you can split the array into m non-empty c

原创 leetcode445. Add Two Numbers II

題目要求 You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes f

原创 leetcode376. Wiggle Subsequence

題目要求 A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate

原创 leetcode448. Find All Numbers Disappeared in an Array

題目要求 Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear onc

原创 leetcode399. Evaluate Division

題目要求 Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real nu

原创 leetcode449. Serialize and Deserialize BST

題目要求 Serialization is the process of converting a data structure or object into a sequence of bits so that it can be sto

原创 leetcode429. N-ary Tree Level Order Traversal

題目要求 Given an n-ary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level

原创 leetcode413. Arithmetic Slices

題目要求 A sequence of number is called arithmetic if it consists of at least three elements and if the difference between a