Ad
  • Default User Avatar

    according to the Kata 4041000 is 4*(6!)+4*(4!)+3! == 2982

    The index is counted from zero upward.

  • Default User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    It's part of the python standard library, so it's not.

  • Custom User Avatar

    Chrono79 made the basic point, but I'll also chime in here. Consider massive data optimization as something that can help your resume! There's a big difference between an engineer for a local small business who can manage thousands of users' data a month versus an engineer who can optimize for thousands of requests per minute. That's the kind of difference that lets someone work for a AAA company or not.

  • Custom User Avatar

    Read the description again:

    NOTE: There will also be lists tested of lengths upwards of 10,000,000 elements. Be sure your code doesn't time out.

    Also, it has a PERFORMANCE tag, what more do you need?

  • Default User Avatar

    I think that is the programming part here, discovering the math and then implementing it. Looking at the wikipedia page, you're not going to reinvent that through trial and error.

    The formula given is a recursive one, which will break, so your programming challenge is how do you make it non-recursive.

  • Custom User Avatar

    yeah python is basically cheating at this point lol

  • Custom User Avatar

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

  • Custom User Avatar

    Well, then know there are algorithmic solutions that work. It's not a math only kata.

  • Custom User Avatar

    Have you seen my solution?

  • Custom User Avatar

    I've created a solution that uses some loops and it worked just fine. It's in Javascript and ported it to Python where it worked fine too, maybe other languages behave different? That you couldn't find an algorithmic solution doesn't mean it doesn't exist. If you're curious about what it is, click View Solution under this post.

  • Custom User Avatar

    Choosing the right algorithm to use is part of a programmer's work. You've been warned at the end about the numbers being large. Nobody forces you to solve this kata, you can pass from it and solve the other one.

  • Custom User Avatar

    Tbh I used to think the same as you. But actually (and because of this kata) i realized that I have to select more carefully the data structure for the problems and not using the list as my default. If you already know that the divisors are unique you wont get the bug of getting twice if you had select the correct data structure (in this case, a set instead of a list).

  • Default User Avatar

    \w also ignores ö,ä,ß. It only matches [A-Za-z0-9_]

  • Loading more items...