Declined challenge quiz 😐 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 10

Declined challenge quiz 😐

//Thanks for the submission, but it seems the code is not matching the answer. Please correct and resubmit. But the answer is correct 100%, and yes it was tricky code. Did this happen to anyone???

29th Oct 2018, 12:42 PM
voja
voja - avatar
10 Answers
+ 4
Voja R C language standard define as "undefined behaviour" when you use an uninitialized var (like sum in your code). This mean that on some compilers, sum will be inited with 0 value (getting your result) on others compiler, instead sum will be not-initialized and will contain random data (usually called gargabe data ). I think that for this your challenge is not been accepted
29th Oct 2018, 5:56 PM
KrOW
KrOW - avatar
+ 10
KrOW oh, makes sense thanks a lot 😃
29th Oct 2018, 6:05 PM
voja
voja - avatar
+ 8
https://code.sololearn.com/c0aoMapDuSfP/?ref=app sum is not inside for loop, so the answer is not 6 (as it seems) but 4. Yes, in quiz I selected 4 as correct answer and the code is the same (no syntax errors, I copied submitted version and pasted here to check output)
29th Oct 2018, 5:43 PM
voja
voja - avatar
+ 3
Well, if its not valid, he have nothing to spoil 😃
29th Oct 2018, 5:35 PM
KrOW
KrOW - avatar
+ 2
Maybe he doesn't want to show his riddle and spoil it. Checking to make sure is definitely a good idea.
29th Oct 2018, 5:32 PM
HonFu
HonFu - avatar
+ 1
Can you post the submitted text and answer?
29th Oct 2018, 1:56 PM
KrOW
KrOW - avatar
+ 1
The reasoning seems a bit random at times. I got 'too many similar problems exist' although not even once I had seen that pattern in a challenge. But because the answer is wrong? Strange... Maybe the decliner was tired? In your place I'd run the code again to see if I'm really really right, check the spelling and indentation very carefully - and then maybe submit it a second time.
29th Oct 2018, 4:03 PM
HonFu
HonFu - avatar
+ 1
I think that its better if he post the challenge and the answer because he can have not noticed something ..
29th Oct 2018, 5:14 PM
KrOW
KrOW - avatar
+ 1
Hehe, how's that for cheering someone up: 'Please show us the riddle, it sucks anyway!' :'-D Voja R, everybody can make a mistake; maybe you spelled something incorrectly, maybe the judge missed that it actually works... IF you test your riddle again, exactly as it is, and it really shows the result you said it does, I'd offer it again. But make sure!
29th Oct 2018, 5:39 PM
HonFu
HonFu - avatar
+ 1
Voja R 👍👍👍
29th Oct 2018, 6:06 PM
KrOW
KrOW - avatar