Why it is overtime

Back to General discussions forum

Liu Chang     2022-11-21 07:27:07

What step should I take to reduce time cost?

I have replace text concatenation from list appendence. It didn't work.

# removed by cunning admin :)
gardengnome     2022-11-21 09:09:59
User avatar

Hi,

Please do not post entire programs here in open threads; this can give too much away to others. Instead, everybody who has solved a particular problem can visit your unsuccessful solution under your profile. For this particular problem, a few observations:

  • There shouldn't be any need for random() decisions.
  • The problem asks for the number of paths, not the paths themselves. Do you really need to store all paths?
  • This problem has the dynamic-programming tag and talks about this approach. Have a look at Dynamic Programming on wikipedia.
Liu Chang     2022-11-21 09:37:15

Sorry again...

Thanks for your patience and tips.

^_^

Please login and solve 5 problems to be able to post at forum