INSAlgo / coding-battle2020

MIT License
2 stars 10 forks source link

Optimize Python solutions for B and C #18

Closed Nyrio closed 3 years ago

Nyrio commented 3 years ago

Optimized by factors 3 and 10 respectively (on my benchmark case, but it can vary of course).

Explanation:

Interestingly, I tried changing palindrome to check only the first half vs second half (the current version being redundant) but it wasn't faster.

Lgt2x commented 3 years ago

Much better this way, thanks !