You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem Link: https://practice.geeksforgeeks.org/problems/find-first-set-bit-1587115620/1
Problem Statement: Given an integer N. The task is to return the position of first set bit found from the right side in the binary representation of the number.
Note: If there is no set bit in the integer N, then return 0 from the function.
Solution Approach: get the first set bit position by right shifting the number till it becomes 0.
*/
/* ------------CODE---------------- */
classSolution
{
//Function to find position of first set bit in the given number.