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.
You are missing one closing brace.
This comment is hidden because it contains spoiler information about the solution
easy
this qas quite easy tbh probably should have been a 7kyu
SIGMAKAIANU OUT!
OP solved it, closing
Thank you very much! Excuse me, I thought that "_" should return -1. But it was my code returned -1. Thanks a lot one more time!
The tests are fine:
JavaScript Completions 84336
Your code returns wrong answers:
Not a kata issue, please fix your code. Don't chain methods like that, it's harder to debug your code, separate them in different steps so you can console.log those middle values and see where the problem is. And take a look at the input of those failed tests and you'll have an idea seeing which chars make your code return
'-1'
.This comment is hidden because it contains spoiler information about the solution
I see, thank you for pointing it out
Your solution has, unfortunately, more than one problem, but you are also interpreting the result of your printing incorrectly.
In your solution function, you have:
return text;
. But your printing is:So effectively you are not printing your result (which is returned by your solution), but something else.
And again, you did not manage to get it working. It appears to be working because your method of verification is faulty. If you'd manage to get it working, it would successfully pass tests :)
I managed to get it working and successfully printed the output. However, it wasn't being accepted for some reason, and I couldn't identify the issue. I was hoping asking here could help me understand if there might be a problem.
Read this article and see if it helps: https://docs.codewars.com/training/training-example
You can also ask for help in
#help-solve
channel of Codewars Discord.What do you mean by "working"? If it were working, it would pass tests, wouldn't it?
This comment is hidden because it contains spoiler information about the solution
Написав код на c++. Обявив змінну типу double, а в кінці її перетворив на int. Проблема в тому, що якщо double ділити, алгоритмом на 10 або 100 для склеїння чисел, і в кінці помножити щоб дістати ціле число то замісь мого очікувано 64116. double тримає його як 0.64115999. І коли я його захочу витягнути 64115.99999.. * 100000 = 64115.999999... (в int дорівнюватиме 64115). Таким чином double зїдає одиничку при перетворення на int.
Loading more items...