6 kyu
Simple Fun #141: Hamming Distance
747 of 1,671myjinxin2015
Description:
Task
The hamming distance
between a pair of numbers is the number of binary bits that differ in their binary notation.
Example
For a = 25, b = 87
, the result should be 4
25: 00011001
87: 01010111
The hamming distance
between these two would be 4
( the 2nd, 5th, 6th, 7th
bit ).
Input/Output
[input]
integera
First Number. 1 <= a <= 2^20
[input]
integerb
Second Number. 1 <= b <= 2^20
[output]
an integer
Hamming Distance
Puzzles
Similar Kata:
Stats:
Created | Feb 17, 2017 |
Published | Feb 17, 2017 |
Warriors Trained | 2661 |
Total Skips | 39 |
Total Code Submissions | 4193 |
Total Times Completed | 1671 |
JavaScript Completions | 476 |
C# Completions | 147 |
Python Completions | 747 |
Ruby Completions | 63 |
C Completions | 170 |
C++ Completions | 170 |
COBOL Completions | 7 |
Factor Completions | 9 |
Haskell Completions | 31 |
λ Calculus Completions | 9 |
Total Stars | 41 |
% of votes with a positive feedback rating | 94% of 350 |
Total "Very Satisfied" Votes | 311 |
Total "Somewhat Satisfied" Votes | 35 |
Total "Not Satisfied" Votes | 4 |
Total Rank Assessments | 10 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |