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.
Nice
so goood
Dope solution.
Although, need to do flooring to get it to work but that's an easy fix I guess, either way still sick.
Honestly, I don't know why this works. The test case: "(()lghk)k)lck)" should have never passed in this code.
Why not try thinking through it with an example and see if with notetaking, you can find a solution that works for you!
Example, imagine an infinite list of ascending numbers:
[1, 2, 3, 4, 5, 6, 7, ...] # find a sum 7
As you go through the list, would you need to parse to infinity to know what values add up to 7? In this constrained example, the fact that ther numbers are ordered gives you the advantage to know that once we're past values that can sum up to 7, that you don't need to look further.
Beyond that, you know by the time you hit
[3, 4]
that there's a matching pair, and you didn't even need to look past the 4th value in that list!The JavaScript code isn't executed by the browser, but by Node JS. It's a runtime to run JavaScript outside a browser (in this case: Codewars's server). So it doesn't matter whether you use Chrome/Firefox/etc.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
That's very clear to me. And you can look at the sample tests:
5 appears 3 times, and the expected answer is 5, so, it's the integer, not the times it appears.
You need to return the value of the integer that appears an odd number of times.
I don't understand what we are supposed to return. Do we return the value of the integer that appears an odd number of times? Or do we return the number of times the odd integer appeared? This kata is very unclear.
well, looks like it is my mistake. I did not understood correctly the word odd
Well, for [18, 1, 7, 1, 1, 1, 18, 18, 7], 18 occurs 3 times (odd number). The other array seems impossible, unless you're modifying the input. (but if so, 3 occurs 7 times, so it's a valid answer)
This comment is hidden because it contains spoiler information about the solution
Wow, I actually thought my solution was decently short lol. Seems to be a pattern
Loading more items...