异或
帘外雨
学生一枚
展开
-
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.Find all the elements that appear twice in this array.Could you do it without extra space原创 2017-09-07 16:06:20 · 188 阅读 · 0 评论 -
LeetCode: 421. 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 in O(n) runtime?Example: Input: [3, 10, 5, 25, 2,原创 2017-09-15 15:13:21 · 244 阅读 · 0 评论