mangaforcodewise.hashnode.net·Apr 6, 2023Bit manipulation & bitwise operatorsLet's dive right into bitwise operators. If you need to operate on numbers of other bases, you first have to convert them to binary. You may come across different prefixes that denote different bases. It is supposed to tell you what base the number i...Royalty and 1 other are discussing this2 people are discussing thisDiscuss·17 likes·604 readsC
Ashutosh KumarforAmazing Algorithmskumarashu.hashnode.net·Mar 4, 2023Count Number Of Set Bits In An IntegerQuestion: Given an integer K, return count of set bits of an integer.Input: 7Output: 3What is Set Bit & Unset Bit?Before answering this question, let me ask you what exactly binary number is?The sequence of digits with base 2 containing ONLY 1 and 0 ...Discuss·10 likes·144 readsBrian Kernighan
Kumar Amitforkumaramit1947.hashnode.net·Apr 8, 2023Using Bit Manipulation to store the occurrence of characters with constant extra spaceProblem Link: Leetcode 2405: Optimal Partition of String Problem Statement: Note: Input string can have only lowercase characters. Understanding the problem: A substring is a contiguous sequence of characters within the string. Thus, the longest su...Discuss·10 likesbit-manipulation
Kumar Amitforkumaramit1947.hashnode.net·Apr 8, 2023Using Bit Manipulation to store the occurrence of characters with constant extra spaceProblem Link: Leetcode 2405: Optimal Partition of String Problem Statement: Note: Input string can have only lowercase characters. Understanding the problem: A substring is a contiguous sequence of characters within the string. Thus, the longest su...Discuss·10 likesbit-manipulation
mangaforcodewise.hashnode.net·Apr 6, 2023Bit manipulation & bitwise operatorsLet's dive right into bitwise operators. If you need to operate on numbers of other bases, you first have to convert them to binary. You may come across different prefixes that denote different bases. It is supposed to tell you what base the number i...Royalty and 1 other are discussing this2 people are discussing thisDiscuss·17 likes·604 readsC
Ashutosh KumarforAmazing Algorithmskumarashu.hashnode.net·Mar 4, 2023Count Number Of Set Bits In An IntegerQuestion: Given an integer K, return count of set bits of an integer.Input: 7Output: 3What is Set Bit & Unset Bit?Before answering this question, let me ask you what exactly binary number is?The sequence of digits with base 2 containing ONLY 1 and 0 ...Discuss·10 likes·144 readsBrian Kernighan
Dukeson Ehigboria O.forsampulcodemine.hashnode.net·Feb 27, 2023BITs Manipulation In ProgrammingBit manipulation is the act of algorithmically manipulating bits or other pieces of data shorter than a word (8 bits or 1 byte). Computer programming tasks that require bit manipulation iinclude low-level device control, error detection, and correcti...Discuss·4 likes·65 readsbit-manipulation
Chirag PatilforChirag's blogdevexplanation.hashnode.net·Feb 4, 2023Swap two numbers with programmingThere are many ways to Swap two numbers in programming. Here I am showing how to swap two numbers optimized and a simple way and also explaining how it works. Swap to number using a temporary variable (not optimized. It takes extra space): For Exampl...Discuss·1 like·45 readsPython 3
Asogwa Emmanuelforasogwa001.hashnode.net·Jan 21, 2023Bitwise and Bitmasking OperationsBitwise Operations Bitwise operations are logical operations that are performed on binary representations of numbers. They include AND, OR, XOR, NOT, and shift operations. These operations can help manipulate individual bits in a register and memory ...Discuss·1 like·58 readsEmbedded Driversc programming
Brian HuforBrian on Leetcodebrianhu.hashnode.net·Dec 24, 202289. Gray CodeLink key ideas Create an array res with size 2^n Set res[0] = 0 as the base case Iterate over the array, trying to insert a valid number in every iteration. To find a valid number, we create another loop, and in this nested loop: toggle the righ...Discussbit-manipulation
Sarath Chandra Reddyforscreddy1313screddy1313.hashnode.net·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 Reddyforscreddy1313screddy1313.hashnode.net·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
Sarath Chandra Reddyforscreddy1313screddy1313.hashnode.net·Oct 18, 2022Leetcode: 136. Single NumberProblem Explanation We are given a non empty array where all elements are repeated twice except one. We need to find that number. Examples : nums = [1,3,1,2,3,2] Output: 2 nums = [5] Output: 5 Different approaches to solve the problem Brute Force ...DiscussCoding Interview Preparationbit-manipulation