Skip to content

Improve move_zeros algorithm (readability and efficiency)#2702

Closed
idowujames wants to merge 1 commit intokeon:mainfrom
idowujames:improve-move-zeros-algorithm
Closed

Improve move_zeros algorithm (readability and efficiency)#2702
idowujames wants to merge 1 commit intokeon:mainfrom
idowujames:improve-move-zeros-algorithm

Conversation

@idowujames
Copy link
Copy Markdown

This update improves the move_zeros algorithm by:

  • Using isinstance(i, bool) for cleaner boolean type checking
  • Avoiding temporary list allocation when appending zeros
  • Clearer inline comments of the if-statement
  • Removed the print statement and function call at the end of the code file

@keon
Copy link
Copy Markdown
Owner

keon commented Feb 17, 2026

Thanks for the suggestion! The change is relatively minor and doesn't significantly improve the algorithm. Closing for now.

@keon keon closed this Feb 17, 2026
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