Hello. You misunderstood what that message says. It says that your returned value 3 is not equal to expected value 36 for some unknown input (actually, that input is n = 8).
Having a quick look at your code, your function always returns in the first iteration of your loop (when i = 1), which is not correct. 1+2+3...+8 is not equal to 3.
Hello. You misunderstood what that message says. It says that your returned value 3 is not equal to expected value 36 for some unknown input (actually, that input is
n = 8
).Having a quick look at your code, your function always returns in the first iteration of your loop (when
i = 1
), which is not correct. 1+2+3...+8 is not equal to 3.Have a look at this article for some general tips: https://docs.codewars.com/training/troubleshooting
Your code is wrong, it always returns 3 for any number greater than 1. Not a kata issue. Please read this: https://docs.codewars.com/training/troubleshooting