Skip to content

working solution#1782

Open
avcode3 wants to merge 1 commit intosuper30admin:masterfrom
avcode3:master
Open

working solution#1782
avcode3 wants to merge 1 commit intosuper30admin:masterfrom
avcode3:master

Conversation

@avcode3
Copy link
Copy Markdown

@avcode3 avcode3 commented Mar 8, 2026

No description provided.

@super30admin
Copy link
Copy Markdown
Owner

  • The solution is correct and efficient.
  • The initial check for head being null is acceptable, but note that without it the code would still work (if head is None, the while loop condition fails and returns prev which is None). So you can simplify by removing the initial check.
  • In Python, it's idiomatic to write while head: instead of while(head): (parentheses are not necessary for conditionals).
  • The variable names are clear and the code is well-structured.

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.

2 participants