Pradeep Chodisettibackend.engg.wiki·Jan 18, 2024XOR using Tries - Part 2Before you go on, please make sure you have read Part 1. Great! Let’s talk about the next usecase. Problem Given an array of integers, find the maximum xor subarray. Or simply,Given a1, a2, ....., an, find i and j , i <= j, such that ai xor ai+1 xor ...Discussalgorithms
Pradeep Chodisettibackend.engg.wiki·Jan 18, 2024XOR using Tries - Part 1Trie Trie can store information about keys/numbers/strings compactly in a tree. Tries consists of nodes, where each node stores a character/bit. We can insert new strings/numbers accordingly. Storing numbers in trie We can store numbers in trie using...Discussalgorithms
Chetan Dattachetan77.hashnode.dev·Oct 26, 2023Subarray with given XORProblem Link Given an array of integers A and an integer B Find the total number of subarrays having bitwise XOR of all elements equal to B. Brute force approach An easy approach is to find all the subarrays, perform XOR operations to compare them wi...DiscussLeetcodeleetcode
Sarath Chandra Reddyscreddy1313.hashnode.dev·Oct 21, 2022Leetcode 1734. Decode XORed PermutationProblem Statement 📃 After reading the question, if you wonder about solving the problem already in the earlier post, then you are actually correct. This is the extension of previous question. For starters, who wish to revise the XOR properties or to...DiscussCoding Interview PreparationXOR
Sarath Chandra Reddyscreddy1313.hashnode.dev·Oct 20, 2022Leetcode 1720. Decode XORed ArrayProblem Description We are given with encoded array, which is XOR of continuous elements of original array i.e encoded[i] = array[i] ^ array[i+1], and we are also given first element of array.. we need to find the original array. Examples: Input: enc...DiscussCoding Interview PreparationXOR
Hyunwoo Choihyunwoochoi.hashnode.dev·Aug 20, 2022XOR problemsXOR Many popular bit manipulation problems require to use XOR in code. In this article, I will introduce couple XOR problems and solution. XOR is represented by ^ in C language. XOR truth table is shown below. When two bits are the same, result is ...Discuss·43 readsbit manipulation coding problemsbit-manipulation