# Leetcode 762 - Prime Number of Set Bits in Binary Representation

Note:

• Know how to check if a num is prime or not (From 2 to floor(sqrt(num))).
• Use memo to remember prev results.

Question:

Given two integers left and right, return the count of numbers in the inclusive range [left, right] having a prime number of set bits in their binary representation.

Recall that the number of set bits an integer has is the number of 1’s present when written in binary.

• For example, 21 written in binary is 10101, which has 3 set bits.

Example:

Code: