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.
according to the Kata 4041000 is 4*(6!)+4*(4!)+3! == 2982
The index is counted from zero upward.
Because python that's why lol
This comment is hidden because it contains spoiler information about the solution
It's part of the python standard library, so it's not.
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.
Read the description again:
Also, it has a
PERFORMANCE
tag, what more do you need?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.
yeah python is basically cheating at this point lol
This comment is hidden because it contains spoiler information about the solution
Well, then know there are algorithmic solutions that work. It's not a math only kata.
Have you seen my solution?
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.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.
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).
\w
also ignores ö,ä,ß. It only matches[A-Za-z0-9_]
Loading more items...