Skip to content

Conversation

obaibula
Copy link
Contributor

  1. It is redundant to use continue in the loop in this case.
  2. The "temp" variable is redundant
  3. There is a built-in "max" function in Go

@Ykhan799 Ykhan799 merged commit ad01256 into neetcode-gh:main Oct 15, 2024
@Ykhan799
Copy link
Collaborator

@obaibula Good refactoring. Thanks for your contribution 👍

@obaibula
Copy link
Contributor Author

@Ykhan799 Thanks!

Just a quick note regarding space removal: unlike in other languages, Go has a standard tool for code formatting called go fmt, which is essential to use. It automatically removes spaces inside square brackets ("[" and "]"), which might seem unusual at first, but this follows Go's official style guidelines. Additionally, all popular Go IDEs enforce "go fmt" before running code. Consistently using go fmt is a must.

Thanks again.

Best regards,
Oleh

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