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.
why use a different iteration method for the first list ?
Yeah, the code failed for most of the cases cuz i made it exclude non-unique prime factors (my understanding of k-primes definition). Now, it works perfectly, but for one last random test lol.
Thanks for the fast response th.
I am very sorry, the C tests are not broken. Not only 40 ppl passed this test but it is common to all languages so 868 ppl passed it. I tried many C solutions and all were fine. I am afraid something is wrong in your code. I also tried your solution with other tests taken from "ATTEMPT" and you fail every one. Cheers.
Tests for C are broken! Please take a look into it! I get this: Expected 2, got 3.
NOTE:
I had the same issue in sample tests what drove me crazy. At the end, I found that the problem is in the first test there were 3 consecutive primes and not 2. Check it yourself:
int a[] = {10081, 10071, 10077, 10065, 10060, 10070, 10086, 10083, 10078, 10076, 10089, 10085, 10063, 10074, 10068, 10073, 10072, 10075};
I am aware that 40 ppl has passed it, but the fact that there is an issue in the sample tests made me frustrated. I debugged the code it passed all sampe tests (after correting the aforementioned one).
Try to add the case when n = 2 ie arr = {1, 4} => 5 and arr {-10, 2}. My code had that bug (since I had to convert it from recursion into iter) and it passed the tests.
careful, tests didn't caught a bug in it (2nd if cond).
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