Adding to a string is a slow and inefficient operation because strings are immutable in python. It's a readable solution, yes, but scale this up far enough and operation time is going to be high. It's far more efficient to create a list of strings and join them.
Your code is too inefficient. prod can be very large in tests, which means your fibonacci function will run way too many times. Try testing locally with an input of 11848599062691545965064653087608697333062993570318609685770465827303336974 (which is an actual input the random tests generated for me), you should see what I mean.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
these are simply multi-line strings, that can also be used as comments.
Encrypting is fairly simple but it's a nice brainteaser to decrypt it! Nice kata.
Adding to a string is a slow and inefficient operation because strings are immutable in python. It's a readable solution, yes, but scale this up far enough and operation time is going to be high. It's far more efficient to create a list of strings and join them.
is there a difference between numpy prod and math prod?
This comment is hidden because it contains spoiler information about the solution
Your code is too inefficient.
prod
can be very large in tests, which means your fibonacci function will run way too many times. Try testing locally with an input of11848599062691545965064653087608697333062993570318609685770465827303336974
(which is an actual input the random tests generated for me), you should see what I mean.This comment is hidden because it contains spoiler information about the solution