Ad
  • 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.

  • Default User Avatar

    recursion is neat

  • 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

    I would argue that in this particular scenario the Stack Class its perfect; From the documentation itself "A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class.", yet in this scenario all of the extra features available with Deque will not be used, a simple stack data structure is more than perfect for this scenario.

  • Default User Avatar

    I'm a bit confused about the challenge. The first test case is for "4041000" to resolve into 2982. According to the rules of the Kata, that'd be 4*(7!)+0*(6!)+4*(5!)... and so on. However, 7! alone is already 5040, so "4041000" can't possibly be the solution.

    What am I not understanding?

  • 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

    My God what a frustrating Kata. It's again one of those, "your solution might work for 100k items but we're testing 5 Million".

    I wish katas that are purely complicated because they require some esoteric levels of optimization would be tagged as such.

  • Default User Avatar

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

  • Default User Avatar

    You shouldn't; defeats the spirit of the game.

  • 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.

  • Default User Avatar

    Well, I GUESS that's an option too.

  • Default User Avatar

    Such an elegant solution. Never heard of Stack class, thank you.

  • Custom User Avatar

    yeah python is basically cheating at this point lol

  • Loading more items...