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

Fix timeout error on hackerrank website #117

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

Conversation

Qambar
Copy link

@Qambar Qambar commented Apr 12, 2023

This optimized version should be more efficient and less likely to cause a timeout error, as it takes advantage of the set operations provided by Python. The complexity of the function is now O(min(len(s1), len(s2))), which is a significant improvement over the original O(len(s1) * len(s2)) complexity.

This optimized version should be more efficient and less likely to cause a timeout error, as it takes advantage of the set operations provided by Python. The complexity of the function is now O(min(len(s1), len(s2))), which is a significant improvement over the original O(len(s1) * len(s2)) complexity.
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