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.
I don't think
count
discards duplicate values, or does it?Yeah I ended up going with the hack of converting to int and back to string for this. :/
This comment is hidden because it contains spoiler information about the solution
'People like you'
Why are you getting personal over the rating of a kata?
I didn't need to look it up because I was taught it in school. Also programming isn't a closed book test. When I program I am standing on the shoulders of giants.
Maybe you should have tried solving it before looking for it in the TextBook?People like you are always strange to me just because Google gives you the solution on the first page doesn't mean that the problem's difficulty changes...
Fixed.
FArekkusu: You also changed the function name, but forgot to change the initial code, could you fix that too?
In python the tests were expecting the function to be named open_or_senior but the provided code template names the function "openOrSenior".
I'm leaving my code in the crappy form it passed in. I normally clean things up and think about optimizations and shortcuts but I'm done with this evil problem.
This kata is far easier than 4kyu. It's a standard binary tree and traversal method. The pseudocode is in every data structures textbook.
Fixed. (You may need to reset the sample tests.)
When I tried to run the haskell unit tests I got:
The name of the test module must end with 'Spec'
Why do the kata in this series execute through oper(fct, s)? Does it make testing easier and faster to implement across supported languages or allow for a functional approach to test writing? IMO that function should be provided already implemented.
int n = 7230702951; // invalid in java. The literal 7230702951 of type int is out of range