Skip to content

Conversation

Dannark
Copy link

@Dannark Dannark commented Sep 25, 2020

It will traverse from start and end at the same time for each iteration in order to use only half of the time.

It will traverse from start and end at the same time for each iteration in other to use only half of the time.
@Dannark
Copy link
Author

Dannark commented Sep 25, 2020

When running %timeit reverse('abcdefghijlmnopqstuvxyz1234567890abcdefghijlmnopqstuvxyz1234567890') The previous method took:

10000 loops, best of 3: 78.3 µs per loop

This one is taking:

100000 loops, best of 3: 12.7 µs per loop

The both methods were tested in colab :)

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.

1 participant