interview-preparation-kit icon indicating copy to clipboard operation
interview-preparation-kit copied to clipboard

Fix timeout error on hackerrank website

Open Qambar opened this issue 2 years ago • 0 comments

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.

Qambar avatar Apr 12 '23 16:04 Qambar