7 kyu
Delta Bits
697 of 3,375ykagan
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 | 6199 |
Total Skips | 1017 |
Total Code Submissions | 14906 |
Total Times Completed | 3375 |
JavaScript Completions | 815 |
Ruby Completions | 383 |
CoffeeScript Completions | 37 |
Java Completions | 1238 |
C# Completions | 159 |
Python Completions | 697 |
NASM Completions | 31 |
C Completions | 184 |
Rust Completions | 33 |
Haskell Completions | 12 |
Total Stars | 73 |
% of votes with a positive feedback rating | 92% of 561 |
Total "Very Satisfied" Votes | 476 |
Total "Somewhat Satisfied" Votes | 75 |
Total "Not Satisfied" Votes | 10 |