Bitwise AND of Numbers Range (LeetCode Challenge Day 23 Question) | Programming Tutorials

preview_player
Показать описание


Given a range [m, n], write a code to return the bitwise AND of all numbers in this range, inclusive.

What is bitwise AND Operator?

Bitwise AND is a binary operator (&). It returns 1 if both the bits are 1 else it returns 0.

0111
0100 &
----
0100


Example 1:

Input : [5, 7]
Output : 4


Example 2:

Input : [0, 1]
Output : 0


Example 3:

Input : [1, 5]
Output: 0

This problem is the day 23 challenge of LeetCode 30 day challenge.

Рекомендации по теме
Комментарии
Автор

thanku sir ur videos are really helpful✌️

praphulyadav
Автор

Nice Explanation, keep doing. why not posted soln for "Construct Binary Search Tree from Preorder Traversal"?

banuchandar
Автор

Hello sir,

Can you please guide me on number 5 to 13,

viditkumar