文章 2017-12-12 来自:开发者社区

[LeetCode] Maximum XOR of Two Numbers in an Array 数组中异或值最大的两个数字

Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai XOR aj, where 0 ≤ i, j < n. Could you do this ...

文章 2017-12-10 来自:开发者社区

[LeetCode] Minimum Moves to Equal Array Elements II 最少移动次数使数组元素相等之二

Given a non-empty integer array, find the minimum number of moves required to make all array elements equal, where a move is incrementing a selected element by 1 or decrementing a selected e...

文章 2017-12-10 来自:开发者社区

[LeetCode] 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. Find all the elements that appear twice in this...

文章 2017-12-10 来自:开发者社区

[LeetCode] 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. Find all the elements of [1, n] inclusive that do not appear i...

文章 2017-12-09 来自:开发者社区

[LeetCode] Contiguous Array 邻近数组

Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1. Example 1: Input: [0,1] Output: 2 Explanation: [0, 1] is the longest contiguous subarray with equa....

文章 2017-12-09 来自:开发者社区

[LeetCode] K-diff Pairs in an Array 数组中差为K的数对

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&nb...

文章 2017-12-08 来自:开发者社区

[LeetCode] 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 t...

文章 2017-12-06 来自:开发者社区

[LeetCode] Split Array into Consecutive Subsequences 将数组分割成连续子序列

You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subsequences consist of at least 3 consecutive integers....

文章 2017-12-06 来自:开发者社区

[LeetCode] Circular Array Loop 环形数组循环

You are given an array of positive and negative integers. If a number n at an index is positive, then move forward n steps. Conversely, if it's negative (-n), move backward n steps. Assume the first ....

文章 2017-12-06 来自:开发者社区

[LeetCode] Degree of an Array 数组的度

Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your task is to find the smallest possibl...

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等