-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
add reverse_bits.py #4120
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
add reverse_bits.py #4120
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
bit_manipulation/reverse_bits.py
Outdated
@@ -0,0 +1,67 @@ | |||
def get_reverse_bit_string(bn : int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file bit_manipulation/reverse_bits.py
, please provide doctest for the function get_reverse_bit_string
bit_manipulation/reverse_bits.py
Outdated
return bit_string | ||
|
||
|
||
def reverse_bit(n: int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the parameter: n
@algorithms-keeper review-all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
bit_manipulation/reverse_bits.py
Outdated
@@ -0,0 +1,67 @@ | |||
def get_reverse_bit_string(num_reversed : int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file bit_manipulation/reverse_bits.py
, please provide doctest for the function get_reverse_bit_string
@algorithms-keeper review |
@algorithms-keeper review |
Why some of the checks are failing?? .. I didn't get, why is it happening.. |
@algorithms-keeper review-all |
@xcodz-dot , hey can u please help me ..... what's wrong with my PR. Will u please review it . |
spelling mistakes
code format (run the below commands at root of repo after fixing the spelling mistakes) pip install pre-commit
pre-commit run -a #(This might show that it has error but this has fixed all the format issues, you can rerun it for your convenience) then upload the changes |
this progress is automatic and runs on every commit or changes you make so you do not need to run this command again and again. |
@xcodz-dot , I have tried everything which u suggest me , but withal some checks are still failing. Kindly please help me,... how to resolve all these errors. |
do not worry about those errors, just commit and upload the local changes made by that |
31d5196
to
3e9f11e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
# https://www.tutorialspoint.com/python3/bitwise_operators_example.htm | ||
|
||
|
||
def binary_xor(a: int, b: int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the parameter: a
Please provide descriptive name for the parameter: b
bit_manipulation/reverse_bits.py
Outdated
@@ -0,0 +1,67 @@ | |||
def get_reverse_bit_string(bn : int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file bit_manipulation/reverse_bits.py
, please provide doctest for the function get_reverse_bit_string
bit_manipulation/reverse_bits.py
Outdated
return bit_string | ||
|
||
|
||
def reverse_bit(n: int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the parameter: n
Ok let me do this here, i will fix all the errors in a while now |
Thank you @xcodz-dot |
Oh and you will have to remove one of the files as only 1 file per PR is allowed, to submit the second file create a new PR after this one gets accepted. Until then keep the second file somewhere on your local machine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper
commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper review
to trigger the checks for only added pull request files@algorithms-keeper review-all
to trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
bit_manipulation/reverse_bits.py
Outdated
@@ -0,0 +1,67 @@ | |||
def get_reverse_bit_string(bn : int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is no test file in this pull request nor any test function or class in the file bit_manipulation/reverse_bits.py
, please provide doctest for the function get_reverse_bit_string
bit_manipulation/reverse_bits.py
Outdated
return bit_string | ||
|
||
|
||
def reverse_bit(n: int) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide descriptive name for the parameter: n
@xcodz-dot , Now, is it good to go? |
yes, please wait for now |
fix all the issues with pre-commit and algorithms-keeper bot
@xcodz-dot, please review my PR. Is everything alright in this PR, have I not made this upto code standard?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not a maintainer here so my review doesn't do much. i will leave the merging part for @dhruvmanila and @cclauss
* add reverse_bits.py * check * Delete binary_xor_operator_new.py * Fix All the errors Co-authored-by: xcodz-dot <[email protected]>
* add reverse_bits.py * check * Delete binary_xor_operator_new.py * Fix All the errors Co-authored-by: xcodz-dot <[email protected]>
* add reverse_bits.py * check * Delete binary_xor_operator_new.py * Fix All the errors Co-authored-by: xcodz-dot <[email protected]>
Describe your change:
I have added an algorithm which reversed the bits of any 32 bit interger .
Checklist:
Fixes: #{$ISSUE_NO}
.