Skip to main content

41 docs tagged with "Bit Manipulation"

View all tags

Binary Watch

This is a solution to the Binary Watch problem on LeetCode.

Bit Difference

This document explains how to convert A to B using bit manipulation.

Counting Bits

This is a solution to the Counting Bits problem on LeetCode.

Find Position of Set Bit

This document covers methods to find the position of the set bit in a number in various programming languages.

Find the Duplicate Number

Given an array of N + 1 size, where each element is between 1 and N. Assuming there is only one duplicate number, your task is to find the duplicate number.

Gray to Binary Equivalent

This document explores different approaches to solving the Gray to Binary Equivalent problem, including brute force, bit manipulation, and optimization techniques, in various programming languages.

Maximum Total Reward Using Operations

This document provides solutions for finding the maximum total reward using dynamic programming and bit manipulation, implemented in C++, Java, and Python.

Maximum XOR With an Element From Array

Solve the problem of finding the maximum bitwise XOR of an element with given elements that do not exceed a specified value using trie and bit manipulation.

Minimize Manhattan Distances

This document provides solutions for Minimize Manhattan Distances using dynamic implemented in C++, Java, and Python.

Number is Sparse or Not

This document covers methods to determine if a number is sparse or not in various programming languages.

Number of 1 Bits(LeetCode)

Write a function that takes the binary representation of a positive integer and returns the number of set bits it has (also known as the Hamming weight).

Power of 2

This tutorial covers the solution to the Power of 2 problem from the GeeksforGeeks.

Power of Four

This is a solution to the Power of Four problem on LeetCode.

Set kth Bit

This document covers methods to set the kth bit of a number to 1 in various programming languages.

Single Number III

Given an integer array `nums`, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once. You can return the answer in any order.

Water-Bottles-II

This document provides solutions for Water-bottles-II solution of leetcode questions