Skip to content

Update 3. Longest Substring Without Repeating Characters.go #50

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

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

JessonChan
Copy link
Contributor

improve

@yangwenmai
Copy link
Contributor

please add some improve benchmark result?

@halfrost
Copy link
Owner

Both your commit and original solution time complexity is O(n). I guess these improve means the code is shorter, beacause it doesn't call max() function. @JessonChan

@JessonChan
Copy link
Contributor Author

@halfrost max function will be inlined to function lengthOfLongestSubstring, so it's the same.
@yangwenmai this pr will reduce loops https://play.golang.org/p/q0M3r1KZbp6

@halfrost halfrost force-pushed the master branch 2 times, most recently from ebcd031 to 7b8ba6f Compare August 19, 2020 07:48
@halfrost
Copy link
Owner

Thanks, wonderful! Your judgment conditions are more excellent. I learned a lot. @JessonChan

@halfrost halfrost merged commit 17aa31b into halfrost:master Aug 19, 2020
halfrost added a commit that referenced this pull request Aug 19, 2020
Update 3. Longest Substring Without Repeating Characters.go
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.

3 participants