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.
Check the instruction again, it's been updated.
You have to find a minimum value in each row and sum that and then return the sum from the function
The instruction to this Kata is too vague. Can someone please explain what exactly our function is supposed to do? Thanks
I've read the discussions and found out that i need a different approach other than using the loops because of the time limit. Can anyone suggest how to go about it? thanks :)
A test result might look something like this:
Which can be copied and run locally.
If you get the correct result locally (here that is 318, but my code returns 319), then you might want to make sure your code compiles without warnings and make sure that you're not using any uninitialized memory. You might for example have an array that you do not initialize, maybe your compiler is zeroing that array and maybe that doesn't happen on codewars. That's behaviour that you should not rely on, if you want an array to be initialized with 0's then you better have code that initializes it with 0's.
(I'm assuming you're using C)
the very same test case fails on codewars but not locally?
I suppose you'd debug it on codewars instead of locally.
and/or get rid of non-standard stuff that only works locally
but if you're not running the same test case, then you don't know anything about it running perfectly since then you aren't running the test in question.
idk how i will do that exactly any tips? I'm asking because the compiler on my device is returning the same expected values from the test, so i'm still confused as to why it failed
use the failing test input to debug your code
My code works perfectly on my laptop but it fails some of the tests produced and i honestly don't know why. Any tips?
sorry. I actually misinteprated the error message and fixed the problem. Thanks for trying to help
thanks for your reply. I found another way to solve it tho :)
You typically do want to stick to integer operations.
If you're in some way using decimals when you carry this out using pen and paper, then you're probably treating them as integers (maybe the unit is 0.25 instead of 1) or as strings (non-infinite series of digits), not float (an approximation).
Maybe you want to look at remainder after division, though not neccessarily. How do you do it with pen and paper? Try to stay true to that.
Rounding is suitable if you're measuring something, approximating something. This is exact. Rounding and approximating shouldn't be in your vocabulary.
I'm coding in C and when month ==8, i get 2 as a return value because of the Int Type. I tried to use the round function to bypass this and i haven't succeeded yet. Anyone got some tips for me?
Why?
The expression (enough(100,60,50)) == (10) is false. <--- This is the message I keep on getting after a Test. I was thinking that should be correct :). Any help?