Now&Here
leetcode561 Array Partition I

leetcode#561 Array Partition I

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), …, (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.

leetcode260 Single Number III

leetcode#260 Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.

leetcode137 Single Number II

leetcode#137 Single Number II

Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.

leetcode136 Single Number

leetcode#136 Single Number

Given an array of integers, every element appears twice except for one. Find that single one.

leetcode643 Maximum Average Subarray I

leetcode#643 Maximum Average Subarray I

Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the maximum average value.

leetcode661 Image Smoother

leetcode#661 Image Smoother

Given a 2D integer matrix M representing the gray scale of an image, you need to design a smoother to make the gray scale of each cell becomes the average gray scale (rounding down) of all the 8 surrounding cells and itself. If a cell has less than 8 surrounding cells, then use as many as you can.

leetcode442 Find All Duplicates in an Array

leetcode#442 Find All Duplicates in an Array

Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once.

leetcode674 Longest Continuous Increasing Subsequence

leetcode#674 Longest Continuous Increasing Subsequence

Given an unsorted array of integers, find the length of longest continuous increasing subsequence.

leetcode448 Find All Numbers Disappeared in an Array

leetcode#448 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 once.

leetcode532 K-diff Pairs in an Array

leetcode#532 K-diff Pairs in an Array

Given an array of integers and an integer k, you need to find the number of unique k-diff pairs in the array. Here a k-diff pair is defined as an integer pair (i, j), where i and j are both numbers in the array and their absolute difference is k.