We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Good question.
usually python3 is much faster than python2. i compared them in lots of exercises here.
in this specific case python2 is really approximatly 20 % faster than 3.
i solved this by using pypy3.
(own test data 5000 characters for s1 and s2
pypy3: 0,7 s
python 3: 8,8 s
python 2 7 s
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Common Child
You are viewing a single comment's thread. Return to all comments →
Good question. usually python3 is much faster than python2. i compared them in lots of exercises here. in this specific case python2 is really approximatly 20 % faster than 3. i solved this by using pypy3. (own test data 5000 characters for s1 and s2
pypy3: 0,7 s
python 3: 8,8 s
python 2 7 s