GoodTecher

Be a Good Techer and Tech for Good. www.goodtecher.com

Skip to content
Menu
  • Home
  • LeetCode
    • Array
    • Binary Search
    • Binary Tree
    • Depth First Search
    • Design
    • Dynamic Programming
    • Linked List
    • Math
    • Stack
    • String
    • Two Pointers
    • Union Find
  • Useful

Category: Bit Manipulation

  • Posted on June 19, 2021June 19, 2021
  • Bit Manipulation

LeetCode 338. Counting Bits

Description https://leetcode.com/problems/counting-bits/ Given an integer n, return an array ans of length n + 1 such that for each i(0 <= i <= n), ans[i] is the number of 1‘s in the…

Continue Reading
  • Posted on May 13, 2021May 13, 2021
  • Bit Manipulation

LeetCode 762. Prime Number of Set Bits in Binary Representation

Description https://leetcode.com/problems/prime-number-of-set-bits-in-binary-representation/ Given two integers left and right, find the count of numbers in the range [left, right] (inclusive) having a prime number of set…

Continue Reading
  • Posted on April 28, 2021April 28, 2021
  • Bit Manipulation

LeetCode 693. Binary Number with Alternating Bits

Description https://leetcode.com/problems/binary-number-with-alternating-bits/ Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have…

Continue Reading
  • Posted on April 10, 2021April 10, 2021
  • Bit Manipulation

LeetCode 1720. Decode XORed Array

Description https://leetcode.com/problems/decode-xored-array/ There is a hidden integer array arr that consists of n non-negative integers. It was encoded into another integer array encoded of length n – 1, such…

Continue Reading
  • Posted on April 7, 2021April 7, 2021
  • Bit Manipulation

LeetCode 1018. Binary Prefix Divisible By 5

Description https://leetcode.com/problems/binary-prefix-divisible-by-5/ Given an array A of 0s and 1s, consider N_i: the i-th subarray from A[0] to A[i] interpreted as a binary number (from most-significant-bit to least-significant-bit.) Return a…

Continue Reading
  • Posted on April 6, 2021July 5, 2021
  • Bit Manipulation

LeetCode 67. Add Binary

Description https://leetcode.com/problems/add-binary/ Given two binary strings a and b, return their sum as a binary string. Example 1: Input: a = “11”, b =…

Continue Reading
  • Posted on March 27, 2021March 27, 2021
  • Bit Manipulation

LeetCode 1356. Sort Integers by The Number of 1 Bits

Description https://leetcode.com/problems/sort-integers-by-the-number-of-1-bits/ Given an integer array arr. You have to sort the integers in the array in ascending order by the number…

Continue Reading
  • Posted on March 24, 2021March 24, 2021
  • Bit Manipulation

LeetCode 868. Binary Gap

Description https://leetcode.com/problems/binary-gap/ Given a positive integer n, find and return the longest distance between any two adjacent 1‘s in the binary representation of n. If there are…

Continue Reading
  • Posted on March 19, 2021March 19, 2021
  • Bit Manipulation

LeetCode 1009. Complement of Base 10 Integer

Description https://leetcode.com/problems/complement-of-base-10-integer/ Every non-negative integer N has a binary representation.  For example, 5 can be represented as “101” in binary, 11 as “1011” in binary, and so on.  Note that…

Continue Reading
  • Posted on March 16, 2021March 19, 2021
  • Bit Manipulation

LeetCode 476. Number Complement

Description https://leetcode.com/problems/number-complement/ Given a positive integer num, output its complement number. The complement strategy is to flip the bits of its binary representation.…

Continue Reading

Posts navigation

Page 1 Page 2 Next Page

Follow GoodTecher

Categories

  • HackerRank (1)
  • Interview (7)
  • LeetCode (588)
    • Array (185)
    • Backtracking (18)
    • Binary Search (19)
    • Binary Tree (63)
    • Bit Manipulation (15)
    • Database (40)
    • Depth First Search (6)
    • Design (10)
    • Dynamic Programming (17)
    • Graph (18)
    • Greedy (5)
    • Heap (1)
    • Linked List (26)
    • Math (36)
    • Recursion (3)
    • Sorting (11)
    • Stack (11)
    • String (95)
    • Two Pointers (12)
    • Union Find (2)
  • Machine Learning (7)
  • Technical Solutions (2)
  • Useful (3)
© Copyright 2025 – GoodTecher
Cell Theme by DesignOrbital ⋅ Powered by WordPress