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 correct. Still cool tho.
I then read about an "obvious O(1) solution" in a comment of the first solution I saw. Thought about it. Solved it in O(1). Thus ignore this solution lol
Works again for me
This seems to be a problem with codewars at the moment, as every Kata I try has this problem currently.
Yes, I'm also getting "unauthorized" on any kata I try at the moment. This seems to be a problem with codewars, not this kata.
The dictionary method needs to instantiate a "useless" dictionary. This one does not.
This comment is hidden because it contains spoiler information about the solution
I was also getting errors outside of my code initially, as under certain circumstances I was returning null in my frequencies method - javascript
How I found my problem is by printing every method call and input, try doing that
Late answer, sorry. Hope you're still up for the challenge!
The problem is that the compiler doesn't know if inside of the foreach something will be returned, so you'd just need to return anything after the foreach, or throw an exception. Then your code should compile
That's actually quite smart
lol
no, as it checks if parantheses is 0 in the end. You do it with an if, this solution returns whether parantheses == 0
you can use
which will be false if
haystack[i]
is null, instead of throwing a NullPointerExceptionlol
well it's not better necessarily
Loading more items...