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.
Because only rows 1 & 2 are reported. Row 0 becomes [0,0,0] after 'S', and the instructions state that the smallest possible array is reported where any row or col has any element > 0.
I did the same thing! I wrote out my solution assuming that punctuation would be part of the word (like in "Hi!"), then got error messages about punctuation. I also left it in, just because.
This comment is hidden because it contains spoiler information about the solution
Thank you Geoff for replying, I am currently thinking about ways to achieve that.
After a bit of reading my solution is probably O(n^3), way off the mark! I'm having trouble imagining another solution that doesn't get into more loops to perform some sort of look-around (effectively my original solution). Memoization seems a bit of a stretch also (but I may be wrong).
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You don't need a sieve to calculate prime factors. Its OP. Look at trial division.
Yes, I'm aware of that one as well. @functools.cache is a newer version of lru_cache and supposed to be faster, but is > 3.9 only.
Turns out memoization wasn't the solution to my problem anyway.
you're looking for functools.lru_cache
Oh! My bad, it's a 3.9 addition. I'd read the docs wrongly. Apologies.
Are the newer Python 3.8 decorators supported? I'm trying to use @functools.cache and receiving an error after functools is imported. This works fine locally on my machine. I want to use this to memoize my functions as I'm currently hitting the execution timeout on the full test suite.
Chrono79, thanks. btw, sorry for flagging it as an issue instead of a question. First discourse post, etc. etc.
Damn thats cool as fk, I guess you learn somethign everyday
Loading more items...