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.
OP solved it with built-in methods, closing
n
andm
, in (2,1), there are 3 points on a line, and 2 more on the arc.The
Maybe
monad in Haskell can be baffling. Don't focus on theInt
/Integer
question here, the problem isMaybe
needs to be handled in a special way. I cannot see how I could help you without giving away the solution, sorry, but I hope you will find some helpful informations there: https://wiki.haskell.org/MaybeYou are wrong. If the base (12 in this case) is even, according to the logic of multiplying, the result must be even too.
I have the same question .... We have the example combinations(2,1) -->(9,3)
In this configuration, we have all the points in a line but one ==> I don't see a way to have a quadrilaterals which is not a triangle + one point on one of the side. I think we need to take the name quadrilaterals in an extend way...
Don't calculate all primes everytime while run each gap(g, m, n), put primes outside the gap() func. I get all nth-primes in O(n) time complexity still time out.Good luck~ after solved, you may find this hint is nothing~ LooooL~
This comment is hidden because it contains spoiler information about the solution
There is an algorithm better than linear. Do some more research, and see if mysterious hint at the end of the description is any helpful.
You're welcome, recursion is a bit tricky until you get the hang of it. Now that you solved it without it, see other solutions that use recursion and analyze how they work.
No problem, the answer to your problem was there too btw:
Already answered below.
Because you used a global var, and it keeps its value when your function is called more than once. Please, I know you said you read it, but read this again: https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution it says there also how to post code with markdown formatting, etc. We wrote it so we don't need to repeat the same over and over.
I mean, there are different labels for posts here, it's documented in the github page, I'll copy and paste what it says about it:
Without a way to reproduce your claim, this is "trust me bro". And that trust is usually not deserved with a comment to this effect. There's no way that others can know that this is different. It probably doesn't lead anywhere either even if you're right, because that still doesn't say what the problem is.
Loading more items...