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.
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.
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.
Now you're asking! Possibly eastern syllabic languages but I'm no expert. eg Tibetan has it's own punctuation for ends of sentences etc but nothing AFAIK for 'word' delimiting. I can't read it, I just chant it...
Agreed, that feels very artificial just to simplify the splitting process and thus the testing process. I coded mine to deal with the eventuality there isn't a space before punctuation.
Agreed, that feels very artificial just to simplify the splitting process and thus the testing process.
Loading more items...