SarthakKeshari / Java-Questions-and-Solutions

This repository aims to solve and create new problems from different spheres of coding. A path to help students to get access to solutions and discuss their doubts.
MIT License
46 stars 95 forks source link

Bitwise AND of Numbers Range #383

Closed satyam878 closed 2 years ago

satyam878 commented 2 years ago

Issue Id you have worked upon -

382

Briefly explain your program logic -

Just took the left most number and the right most number and performed right shift till both the number gets equal and jumps out of the loop, along with that i have counted no of times the loop is executed and later on left shifting the leftmost number by the count.

Screenshots(Attach 2 screenshots of your own input and output) -

image image


Checklist:

Eg - If your code follow the below guidelines. Kindly change [] to [x]

All the conditions should be fulfilled for considering your code for merging -

satyam878 commented 2 years ago

Kindly accept my pull request @SarthakKeshari

SarthakKeshari commented 2 years ago

@satyam878, There are two files showing up which is conflicting. Kindly look into it and commit again