Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Did you solve it though? Also don't understand it
EDIT: solved it. For future users, refer to the previous comment made in this discussion:
It's not clear that the input represents a price timeline where the sale occurs sometime after the purchase, and not, say, a list of shops where you can trade freely.
This kata requires no optimization whatsoever.
Read about properties of prime numbers, filter the possible divisors and their upper-bounds instead of doing an exponential-complexity computation.
I didn' mean it's a bad approach, seems fine and it should work if your code is right. It's just not necessary (there are different possibilities depending on the language you're using), you will see it when you solve this kata :)
Since weeks have been following each other without interrumption since so, you can do it many other ways. It doesn't matter how you do it, the important is your code returns the right result. I'm sure most people who solved this kata (and I) didn't know this.
This comment is hidden because it contains spoiler information about the solution