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.
Care to share a link?!
Peter want to watch the world burn (º/\º)
If only there would be a need for less-than-bruteforce factorization.
A hint: there are at least two functions available from importable modules that you can use directly.
Not so easy. Imagine this: https://www.codewars.com/kata/reviews/55661000acc711e892000009/groups/5fab78001696050001928386
Really, this digs up a builtin.
if exponent is 0 should return 1 instead of 0, provided modulus is more than 1. x^0===1 (mod y) y>1.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
While studying the problem I've stumbled on an online tool to generate such regexes. It was an ordeal trying to make the regex by hand using principles explained in there, but at least I did my own in here :)
I see familiar digits in here. I wonder if this outcome is equalling mine.
Where I currently am, I cannot see the full test suite. Did you print the input? if it causes timeout, use
print(..., flush=True)
, then you'll understand what the problem is, I guess.This comment is hidden because it contains spoiler information about the solution
A new thing: I passed all tests but the "precheck" and the kata does not let me through. Yes I used inefficient algorithms most likely, yet I did a worthy shortcut across wild-guessing over a largely uncovered field without clues. What's there in the precheck that makes me stuck for 1 second or above? I don't want to shortcut the precheck too. (Also maybe my precalculations for a decent try run for too long per test, yet they help)
So, am I right that the challenge implies that zeroes provided at the start are ALL of those that exist on the map? If yes, this is a flaw in the kata's description, not the tests, and a piece of information I really did not use yet.
Loading more items...