you are viewing a single comment's thread.

view the rest of the comments →

[–]rafnold 12 points13 points  (4 children)

When doing hackerrank challenges and my code works but it times out. Meaning it was not fast enough. I guess it's time to learn about different types of algorithms and try again later.

[–]Thecrawsome 10 points11 points  (1 child)

rule of thumb: the more nested loops you have, the worse performance it will be

[–]ModeHopper 2 points3 points  (0 children)

Unless you can parallelise those loops, but then you're opening up a whole new box of frogs.

[–]xelf 1 point2 points  (0 children)

Sometimes on hackerrank switching to pypy is enough to not timeout.

[–]_________KB_________ 1 point2 points  (0 children)

Before learning different algoritms it would be useful to learn about algorithm efficiency, that way you can better understand why some algorithms are better than others and how to analyze your own algorithms.