tips to make your code faster in python

Revision en1, by Gaspiboy, 2020-09-18 16:15:09

102694A - 3 - Circumference of a Tree - my code : 93116273

hi guys, i have trouble to pass this problem. My code seems to work but it is too slow ( i have the error: Time limit exceeded on test 4) the thing is that the complexity is already O(n) and i really don't know how to make it faster. I use python and i know that this language is slower than the others, but i saw that other people succeeded to do this challenge with pypy3. Do you have any tips for me ?

Thank you very much !!

Tags python, #optimization, tree

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Gaspiboy 2020-09-18 16:15:09 535 Initial revision (published)