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.
actually i solved the kata initially i didnt get what this kata wants
"You need to find all number that doesnt contain 5 in them in a given range and return the total of such number"
like 54 has 5 in it, we should not count it and also range can contain -ve number so watch that out
same here man
Hi, Actually i had same thoughts about if else heirarchy(still i have same).
Before writing this comment i executed following code in C in Code Blocks 16.01
int x=1;
if(x==1)
printf("1");
else if(x>0)
printf("2");
else if(x<3);
printf("3");
and i got 13 as answer(in C) so based on this fact that if else is same for every programming language i commented on this.
but but i also tested this in differnet language after reading ur comment i got answer as 1 only.
That's not how
else if
s work. Once oneif
is satisfied, it breaks out of theelse if
chain. By your logic, 15 would actually be added thrice:15 % 3 == 0
and15 % 5 == 0
so that will trigger the first one, then the secondelse if
will trigger and so will the third.The test case implies there is an array being passed, yet you say that
number
is not an array.Edit: Also, you are simply
console.log(abc)
rather thanreturn abc
, might that be the issue?If a number such as 15 has encountered in your case it will be added twice
1st in first if case and 2ndly in 3rd else if case so just put your 1st if statement having '||' instead of '&&' so it will take care of every case.
iam getting this error
"terminating with unexpected exception of type std::exception*"
Language used is c++
The same happened to me but I fixed it by removing some print statements. Just in case anyone else has this issue.
thanks i got it
If it keeps happening you might have either allocated an array too big, or your code is too slow.
iam able to pass test cases but while attempting it shows
"Server Execution Error:
The server attempted to execute your code but there was an issue with the request. This should be a rare issue. Please try running your code again. If the issue persists, please contact us."
help plz
iam able to pass test cases but while attempting its showing Process exited prematurely with a SIGSEGV signal.
"is there any memory limit" and my code is not trying to accesss any invalid memory!!!
because i have tested my code in my IDE by those cases were in final test cases
i got final test case by removing all of my code and just printing vector passed and by seeing expected result
Expected: equal to [ J vltasl rlhr , zdfog odxr ypw, atasl rlhr p , gwkzzyq zntyhv, lvz wp!!! ]
Actual: [ J vltasl rlhr , zdfog odxr ypw , atasl rlhr p , gwkzzyq zntyhv , lvz wp!!! ]
i'am not getting it....
please help.
tell me how you solve this problem
i'am getting same problem
my answer is correct but its shows following output
Time: 11ms Passed: 0 Failed: 0
Test Results:
dont_give_me_five_tests
example_tests
Log
8Expected: equal to 8
Actual: 0
-------help me out plz------