• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
November 01, 2023 |1.2K Views
SDE Sheet - Rightmost different bit
  Share  4 Likes
Description
Discussion

This video is part of the Bit Manipulation section under the GFG SDE Sheet.

In this problem, we are given two numbers M and N. The task is to find the position of the rightmost different bit in the binary representation of numbers.

Example :

Input: M = 11, N = 9
Output: 2

Explanation: Binary representation of the given numbers are: 1011 and 1001, 2nd bit from right is different.

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-
Article: https://www.geeksforgeeks.org/position-rightmost-different-bit/
Problem: https://practice.geeksforgeeks.org/problems/rightmost-different-bit-1587115621/1
SDE Sheet Link: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More