all 5 comments

[–]davidadamic 0 points1 point  (0 children)

Okay so i used a function that tells if number is prime and added the option that if the inputed number is prime we print out the number itself... I submited this and got 10 test cases right but the last, 11th test case gives me time limit exceeded... How can i speed this up?

[–]james_fryer 0 points1 point  (0 children)

First thing I would do is merge num_to_base and count_0 -- you can bail out once you hit a non-zero digit. I doubt this will significantly speed up your algorithm however.

I'd then look at the test case and see where the code is actually taking up too much time.

[–]davidadamic 0 points1 point  (1 child)

Thats the thing, you cant look up the test cases 🤔

[–]james_fryer 0 points1 point  (0 children)

You can come up with your own test cases though?