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 comment is hidden because it contains spoiler information about the solution
char result[100000] = {0};
-- you create local array. And return pointer to it:return result;
. But after you leave the functionfactors()
pointer becomes invalid. Therefore, undefined behavior here.This comment is hidden because it contains spoiler information about the solution
I tried again too, and it works indeed... First time, I didn't remeber that in C cast was implicit in an operation like that, maybe the parentheses I've add (somthing like (int)'f'), or a typo I didn't saw. Anyway, that's my bad, sorry!
This comment is hidden because it contains spoiler information about the solution
That's what I tryed first but he told me that I was using a forbiden caracter!? Did they revoke the modulo char? If that's it, they should put it in the forbiden caracters list...
free(arr); <-this thing have no sense at all, it will never execute
Probably there is problem with range, in C version you are forced to return int where some of the random values are from long long range? Dunno, maybe that`s the fault. Edit: Okay, probably i was wrong. In my code casting the result of log10 function to int before comparing helped to pass the random test. I forgotten to do that, so that was the fault.