Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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 :)

  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution