{ "@context": "https://schema.org", "@graph": [ { "@type": "WebSite", "@id": "https://www.ggorantala.dev/#website", "url": "https://www.ggorantala.dev/", "name": "Gopi Gorantala", "description": "Staff engineer building Kafka and Flink platforms for banking. Production failures traced to root cause." }, { "@type": "Person", "@id": "https://www.ggorantala.dev/#person", "name": "Gopi Gorantala", "url": "https://www.ggorantala.dev/", "jobTitle": "Staff Software Engineer", "worksFor": { "@type": "Organization", "name": "ING Bank" }, "sameAs": [ "https://x.com/ggorantala", "https://www.linkedin.com/in/ggorantala/", "https://github.com/ggorantala", "https://leetcode.com/ggorantala" ] } ] }
Skip to content

XOR Operator

10 Posts

Solution Review: Missing Number

We solved the problem using lookup (hashtable), using the mathematical formula. Let's solve this more efficiently using bit-level operations with XOR and then optimize the solution.

Challenge 2: Missing Number

In this article, we'll learn various ways to find the missing number in an array. We use a memoization approach, a mathematical approach, and the most optimized way using the XOR operator.

Solution Review: Single Number

Single Number coding question, can be easily solved with XOR bitwise technique with linear time complexity.

Challenge 1: Single Number

In this lesson, every element appears twice except one element. We solve this using naive, and then we move to solve it more optimally using XOR operator.

Hamming Distance

Hamming distance talks about two integers where the bit positions where the corresponding bits are different.

Detect If Two Integers Have Opposite Signs

In this question, input two numbers and detect if they have opposite signs. We solve using bitwise XOR operator

Find Odd Occurring Element

In this coding question, we find the odd-appearing element using bitwise xor. This algorithm is simple yet powerful.

Swap Two Numbers

In this lesson, we use the XOR operator to swap the values of two inputs. Introduction In this question, input

Bitwise XOR, Computations, and Examples

Introduction A Bitwise XOR is a binary operation that takes two-bit patterns of equal length and performs the logical

Introduction to XOR

The Bitwise XOR operator is denoted by ^. When an XOR gate is given with 2 inputs, the corresponding outputs will