异或
Krystalcsdn
这个作者很懒,什么都没留下…
展开
-
Google Kickstart 2019G The Equation
ProblemThe laws of the universe can be represented by an array ofNnon-negative integers. The i-th of these integers isAi.The universe isgoodif there is a non-negative integer k such that the ...原创 2019-11-14 19:35:47 · 265 阅读 · 0 评论 -
leetcode数组中选出两个具有最大异或值的数
题目给定一个非空数组,数组中元素为 a0, a1, a2, … , an-1,其中 0 ≤ ai < 231。找到 ai 和aj最大的异或 (XOR) 运算结果,其中0 ≤ i,j < n。你能在O(n)的时间解决这个问题吗?示例:输入: [3, 10, 5, 25, 2, 8]输出: 28解释: 最大的结果是 5 ^ 25 = 28.代码...原创 2019-10-15 15:20:13 · 397 阅读 · 0 评论