Learn
Practice
Newsletter
Resources
Animations
New
F
Toggle theme
0
F
0
Toggle menu
← Back to All Animations
Bitwise AND of Numbers Range
Bookmark
Input
Example 1
Example 2
Example 3
Custom
left
=
5
,
right
=
7
7
6
5
4
3
2
1
0
left
= 5
& right
= 7
result
0
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
algo
master
.
io
Step:
AND every number from 5 to 7: the differing low bits get wiped out, only the shared prefix survives
0 / 8
Input
Example 1
Example 2
Example 3
Custom
left
=
5
,
right
=
7
0 / 8
7
6
5
4
3
2
1
0
left
= 5
& right
= 7
result
0
0
0
0
0
1
0
1
0
0
0
0
0
1
1
1
algo
master
.
io
Step:
AND every number from 5 to 7: the differing low bits get wiped out, only the shared prefix survives