LeetCode – 532. 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 t…

LeetCode – 496. Next Greater Element I

LeetCode – 496. Next Greater Element I

You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of n…

LeetCode – 485. Max Consecutive Ones

LeetCode – 485. Max Consecutive Ones

Given a binary array, find the maximum number of consecutive 1s in this array. Example 1: Input: [1,…

LeetCode – 453. Minimum Moves to Equal Array Elements

LeetCode – 453. 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 arr…

LeetCode – 448. 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 ot…

LeetCode – 414. Third Maximum Number

LeetCode – 414. Third Maximum Number

Given a non-empty array of integers, return the third maximum number in this array. If it does not e…

LeetCode – 350. Intersection of Two Arrays II

LeetCode – 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1…

LeetCode – 349. Intersection of Two Arrays

LeetCode – 349. Intersection of Two Arrays

Given two arrays, write a function to compute their intersection. Example: Given nums1 = [1, 2, 2, 1…

LeetCode – 303. Range Sum Query – Immutable

LeetCode – 303. Range Sum Query – Immutable

Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive…

LeetCode – 283. Move Zeroes

LeetCode – 283. Move Zeroes

Given an array nums, write a function to move all 0‘s to the end of it while maintaining the r…

返回顶部