Yes you are right, your method is wrong for 456. I just do not see how the code you pasted can produce the behavior you describe, that's why either I get you wrong, or you interpret something differently than it really is.
What happens when you delete test case 1 and run only test case 2? For 456, valid answer is 6. Do you get locally answer 6 when you run your solution for n=456?
It kept outputting 1+6+4+5+6 = 16.
I don;t see how this can happen with your code and current tests. Is this exactly the output you get in logs?
Dude i already read that thing so many times its too vague.I need actual help from someone.For me the code just kept running both test cases at once which outputted 16.
Test case 1 = 16 , Test case 2 = 456,
It kept outputting 1+6+4+5+6 = 16.
It overrode the first test case and just submitted the solution for test case 2 to test case 1.Only when i deleted test case 2 and ran it individually did i get a correct answer but i cant do that for the actual attempt so i guess my method just doesnt work for these test cases.
Guys can anyone help me as to why the kata seems to running boht test cases at once?My code is fine on netbeans but with the test cases it has a problem.
Netbeans-Test case : 16 , Output = 7
This Kata-Test case : 16 , Output = 15
I really have no idea why its doing this but i can assume that this is becuase codewars might have a few buggy katas.
Added random tests to Coffeescript and Java.
Separated the assertions in diferent tests and added 100 random tests in Java.
I'd recommend you to read some particular paragraph in some very vague FAQ, but I won't ;)
Look at spaces around
2
.This comment is hidden because it contains spoiler information about the solution
You might have been tripped up by the fact that there's no log for the first test (
16
) because you passed it. So this is mistaken:Test case is actually
456
. You'll see it if you print the input.and what about this?
...and why are you mixing the inputs of 2 different tests...????
Yes you are right, your method is wrong for 456. I just do not see how the code you pasted can produce the behavior you describe, that's why either I get you wrong, or you interpret something differently than it really is.
What happens when you delete test case 1 and run only test case 2? For 456, valid answer is 6. Do you get locally answer 6 when you run your solution for n=456?
I don;t see how this can happen with your code and current tests. Is this exactly the output you get in logs?
Dude i already read that thing so many times its too vague.I need actual help from someone.For me the code just kept running both test cases at once which outputted 16.
Test case 1 = 16 , Test case 2 = 456,
It kept outputting 1+6+4+5+6 = 16.
It overrode the first test case and just submitted the solution for test case 2 to test case 1.Only when i deleted test case 2 and ran it individually did i get a correct answer but i cant do that for the actual attempt so i guess my method just doesnt work for these test cases.
Your code works correctly for
16
also here on Codewars. It works wrong for456
.Maybe this could explain why you probably misread the logs.
.
This comment is hidden because it contains spoiler information about the solution
Guys can anyone help me as to why the kata seems to running boht test cases at once?My code is fine on netbeans but with the test cases it has a problem.
Netbeans-Test case : 16 , Output = 7
This Kata-Test case : 16 , Output = 15
I really have no idea why its doing this but i can assume that this is becuase codewars might have a few buggy katas.
Nvm i already got the answer.I kept getting a StringOutOfBoundsException so i just didnt use arrays entirely.Thanks for your time and concern man.
Then, following the instructions there, post your code here, so we can check what's wrong.
Doesnt really help me much.I did what they said and im still getting an error but when i run the code on netbeans its fine.
Loading more items...