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.
It would make more sense to use an assoc list for the towns argument just like it is for the distances arg. Also maybe drop arrays altogether and use lists
how?
The translation to ocaml is really not very good...
k
seems to be a single digit number, andn
is only up to a few million (7 digits) long (Python version), so if you're getting timeouts, you should reconsider your approach.I don't think of how much k can be, bc idk the max values for n or p, so the code freezes on codewars for veeery big iterations of k
Could you provide an example at least? Did you read that once reversed they should be a different number? So 11 is not a valid result, neither 2, 3, 5 nor 7. If you're sure there is the problem with the tests, provide your code and the language you're working on, the problem may exist only in that one.
There is a problem with tests, as they don't include all correct results in the resulting list. I get more values and those additional ones also correct, so there is something wrong with tests and answers. Please fix
The expected value for that test is this one:
1:ooo/1:uuu/2:sss/=:nnn/1:ii/2:aa/2:dd/2:ee/=:gg"
Seems like this kata has issues in test in js part
The description says:
I assume they must be ordered based on full substring (like i need to compare
1:uuu
with2:sss
for example), but in that case2:sss/1:uuu
part of the test assertion breaks the rule.Same problem if the substrings must be sorted based on corresponding character (like
u
ands
) - then the1:ii/2:aa
part breaks the rule.There are three possible reasons - description is incorrect, tests are incorrect, or i'm really dumb
If you guys know how exactly it should be sorted, please tell me...
Nice and simple but inefficient the bigger the number gets since you need to compare every single value till that number.
I cant understand the question at all
In case this is a question you forgot to null-terminate your result string.
Edit: Just saw the next post.
Count the appearances of the digit
d
in the squares of all numbers from 0 ton
.I tried it both ways. If I return 0s I get more errors in random tests. If I return "" I get less errors. But still get errors
There's a very poor description of the condition in the kata!!!
I'll add a condition that will help you solve the problem.
You need to check that it does not return null variants.
For example, you have stock_list([[“ABART 20”, “CDXEF 50”, “DKWRK 25”, “BTSQZ 89”, “DRTYM 60”], [“W”, “H”]))
Your program will return the value "(W : 0) - (H : 0)", but since all values here are NULL, the program MUST RETURN an empty string ""
Loading more items...