---
title: "Discussion on \"Maximum XOR of Two Numbers in an Array\" | Hashnode"
description: "Discussion on \"Maximum XOR of Two Numbers in an Array\". Problem\nGiven an integer array nums, return the maximum result of nums[i] XOR nums[j], where 0 <= i <= j < n. (link)\nExample 1:\nInput: nums = [3,10,5,25,2,8]\nOutput: 28\nExplanation: The maximum result is 5 XOR 25 = 28.\n\nExample 2:\nInput: nums = [14,7..."
url: "https://hashnode.com/posts/maximum-xor-of-two-numbers-in-an-array/69690349d264bb6cff78f2e0"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Maximum XOR of Two Numbers in an Array](https://chetan77.hashnode.dev/maximum-xor-of-two-numbers-in-an-array?utm_source=hashnode&utm_medium=feed)

Problem Given an integer array nums, return the maximum result of nums\[i\] XOR nums\[j\], where 0 <= i <= j < n. (link) Example 1: Input: nums = \[3,10,5,25,2,8\] Output: 28 Explanation: The maximum result is 5 XOR 25 = 28. Example 2: Input: nums = \[14,7...

Jan 15 · 2 min read · chetan77.hashnode.dev  
Read the article

-   [#maximum-xor-of-two-numbers-in-an-array](https://hashnode.com/tag/maximum-xor-of-two-numbers-in-an-array)
-   [#trie](https://hashnode.com/tag/trie)
-   [#xor](https://hashnode.com/tag/xor)
-   [#bit-manipulation](https://hashnode.com/tag/bit-manipulation)
-   [#dsa](https://hashnode.com/tag/dsa)
-   [#leetcode](https://hashnode.com/tag/leetcode)

## Written by

[Chetan Datta](https://hashnode.com/@chetan77)

@chetan77 · Hyderabad, India

  
[View profile](https://hashnode.com/@chetan77)

Software Engineer

I share my learnings here. Thanks for reading.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
