7 kyu
Delta Bits
819 of 3,408ykagan
Description:
Complete the function to determine the number of bits required to convert integer A
to integer B
(where A
and B
>= 0)
The upper limit for A
and B
is 216, int.MaxValue
or similar.
For example, you can change 31 to 14 by flipping the 4th and 0th bit:
31 0 0 0 1 1 1 1 1
14 0 0 0 0 1 1 1 0
--- ---------------
bit 7 6 5 4 3 2 1 0
Thus 31
and 14
should return 2
.
Bits
Binary
Algorithms
Similar Kata:
Stats:
Created | May 31, 2014 |
Published | May 31, 2014 |
Warriors Trained | 6277 |
Total Skips | 1017 |
Total Code Submissions | 14984 |
Total Times Completed | 3408 |
JavaScript Completions | 819 |
Ruby Completions | 386 |
CoffeeScript Completions | 37 |
Java Completions | 1243 |
C# Completions | 160 |
Python Completions | 710 |
NASM Completions | 31 |
C Completions | 188 |
Rust Completions | 36 |
Haskell Completions | 16 |
Total Stars | 73 |
% of votes with a positive feedback rating | 92% of 565 |
Total "Very Satisfied" Votes | 480 |
Total "Somewhat Satisfied" Votes | 75 |
Total "Not Satisfied" Votes | 10 |