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.
Nice kata! Might seem like difficult math but a lot of the math is actually given in kata description so all that is needed is profficiency and confidence in reasonably basic (for 2kyu level) mathematics. The math involved (that you are essentially given) is relevant to several important fields including encryption.
Very strange implementation.... it even "deletes" attribute that never existed either at instance or at class level.
This comment is hidden because it contains spoiler information about the solution
Unfortunately it appears that your k-means solution is not available for me to view - probaly because it was not in Python and I solved in Pyhton as would be interesting. Looking at top solutions that I can see I can say that they involve tweakery to the test cases (they are deceptively short as there is surely a lot of analysis of the uderlying test cases behind them) and the statement at the top of the kata "transmission is generally accurate according to the standard, but some dots and dashes and pauses are a bit shorter or a bit longer than the others." is very missleading given the extremely unnatural distributions involved.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
It is nowhere close to being a solution to the 50x50 version. It took 3 days and nights to get from this to passing the multisize version. This code will not only run 5 times too slow for the multisize version it will actually fail to produce answers for about 10% of the cases in the multisize version. After three days and almost giving up I passed hard version only by trying many times and that is after some extreme optimisation and endless time in cPrifile and line_profiler. The sort of things I had to take into account is like:
a = 0 or 1 depending on some condition
var = a in numpyarray.tolist()
runs much slower than:
a = 0 or 1 depending on some condition
if a =0:
var = 0 in numpyarray.tolist()
if a = 1:
var = 1 in numpyarray.tolist()
Not only I had to introduce lots of new functionaluty to pass multisize version I had to introduce lots of hyperparameters that had to be fine tuned to pass. And even Python version makes difference as 3.8 is just a bit slower so had to chnage to 3.6 as no way my code (after three days of working from the above state) would pass on 3.8.
I did sole level 1 katas in just 0.5 days (4 hours), most a bit longer but not longer than a day or two (day being 8 hours). The multisize version of this .... even from this code the journy is harder than solving about 4 other level1 katas....
This is a very difficult kata. I solved it only ... after solving 1kyu continuatin of this kata. So my advice for anyone else struggling (like I did for days) would be to think how you would solve the related 1kyu kata which would enable to rule out some of the standard approaches that should be more than sufficient for this 3kyu kata but which in fact are not. Also tags on ths kata are incorrect and while you might/should start with writing the equations that would be used for Linear Programming this kata is not solved by Linear Programming.
This comment is hidden because it contains spoiler information about the solution
This appears to be very similar to "the best" soution for 6x6 which involves:
Appears to be lighting fast though I do not understand why it works. Probably has to do with bow these kind of puzzles are generated in the first place.
This works really lighting fast on 7x7 except for the last medved puzzle which I suppose was put in to beark this particular solution. So here the modofication is that a limit of 10 cycles is placed on the above approach (for p in range(10)) this presumingly even if does not solve the problem like mdeved problem prunes the sets a lot. and then brute force is used by building a product of (presumingly by the above process) pruned allowed sets of row permutations and testing them.
Would be interesting if authores could come up with an example that would break this solution (like they did with medved that broke the 6x6 solution).
Overall one does not learn much from this solution like one would learn from proper backtracking with extreme pruning.