Count the Set Bits
Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.
The problem
- easy
- Pro
Given a non-negative integer, count how many ones there are in its binary form. Explain a simple way, then a trick that only does as many steps as there are ones.
Talk this problem through with an AI coach
This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.