Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I added the code for Check whether a number is divisible by 2^k or not . #2927

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Tirth9978
Copy link

Added the function isDivisibleBy2PowerK() to check divisibility by 2 ^ k . Optimized using bitwise AND operation for constant time check
--> Worst Case Time Complexity: O(1)
--> Space Complexity: O(1)
--> Included extensive test cases covering:

@Tirth9978 Tirth9978 marked this pull request as draft April 5, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant