forked from trekhleb/javascript-algorithms
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitsDiff.js
More file actions
Latest commit
13 lines (12 loc) · 321 Bytes
/
Copy pathbitsDiff.js
File metadata and controls
13 lines (12 loc) · 321 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
importcountSetBitsfrom'./countSetBits';
/**
* Counts the number of bits that need to be change in order
* to convert numberA to numberB.
*
* @param {number} numberA
* @param {number} numberB
* @return {number}
*/
exportdefaultfunctionbitsDiff(numberA,numberB){
returncountSetBits(numberA^numberB);
}