-
-
Notifications
You must be signed in to change notification settings - Fork 46.8k
circular_linked_list: Add more len() tests #2051
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
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.
Just a check for black length required from my end
else: | ||
while current_node.next_ptr != self.head: | ||
current_node = current_node.next_ptr | ||
|
||
current_node.next_ptr = self.head.next_ptr | ||
self.head = self.head.next_ptr | ||
|
||
self.length -= 1 | ||
self.length -= 1 |
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.
Good catch 👍
[(c1, c2) for c1, c2 in zip(matching_1, matching_2) if c1 != c2] | ||
) // 2 | ||
transpositions = ( | ||
len([(c1, c2) for c1, c2 in zip(matching_1, matching_2) if c1 != c2]) // 2 |
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.
This line has a length of 82 chars, is it below our threshold?
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.
Black max_line_length is 88 characters.
* circular_linked_list: Add more len() tests * fixup! Format Python code with psf/black push * prepend() * updating DIRECTORY.md * Fix decrementation of self.length * Add empty list tests Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Describe your change:
Add more len() and delete() tests
Checklist:
Fixes: #{$ISSUE_NO}
.