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

adding an edge case missed in linked list remove_nth_node_from_end.py #457

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sshsrijanr
Copy link

@sshsrijanr sshsrijanr commented Oct 2, 2024

Case when the length of the linked list and N is equal

Description

In the Linked List Problem of Removing nth Node from the End, One of the cases was missed where the length of the linked list is equal to n, In this case, the current code throws AttributeError: 'NoneType' object has no attribute 'next'

Fixes # (issue)

  1. Adding an extra node in front
  2. Return value from function remove was not assigned to head

Type of change

  • [*] Bug fix (non-breaking change which fixes an issue)

… - when length of linked list and N is same current code throws Error
@sshsrijanr sshsrijanr changed the title adding an edge case missed in linked list remove_nth_node_from_end.p… adding an edge case missed in linked list remove_nth_node_from_end.py Oct 2, 2024
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.

1 participant