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.
this problem seems to be very hard. please try to solve it. the time limit is 12000ms. your solution may take too much
Trust me on this one. My code does have the correct answer. I used my code on some bigger cases and it worked.
The time my solution takes is around O(N^2 log(N)). There is also some optimization that can lead to decrease in time by constant factor. If you have failed random test cases, then that means your solution is too slow. My solution ends up around 11500 ms which is close to 12000 ms, the time limit.
Your solution is too slow then. It needs to be O(N^2 log(N))
Well, I guess I can fix this by making it 2.
This problem can be solved in 38 lines by the way.
Is this question too hard? How long does it take for people to solve katas like these?
Have you tried the new kata?
It should work now (;
https://www.codewars.com/kata/5fe0fabb14b66600090dad75
fixed it
I admit that this takes a bit of thinking to come up with a solution, but you need to do a bit of critical thinking to get the solution. One hint that I can give is combinatorics. The sum is a running total, and you have to use combinotrics to find a multiplication to add to said sum
Blind4Basics, I think the random matrix generation takes too much time, my solution is O(N^2log(N))
I have a pastebin of the random generation here:
https://pastebin.com/NhVG8L7L
I did not put my solution here, just random generation
The NxN matrix has many 0's but there is a 1 in each row. The random generation does work; I tested it out
I fixed the random tests by changing the matrix.
mat = [[0 for j in range(N)] for j in range(N)]
Yeah, I started train before I fixed it, and after I submit it and went back to retrain it, the error was gone, so there should be no other big mistake for this kata.
Loading more items...