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.
Regarding the 50% rule, I don't think it is what you describe, since it also says "Based on extensive tests, the normal rate is around 35%" which would'nt make sense since we have 62 characters and only a max length of 20. If it is what you describe, the rate "normal" rate should be much lower.
This comment is hidden because it contains spoiler information about the solution
Well, I'm not sure if by "brute force" you meant the wikipedia method, but it worked pretty well :p
Nice kata
C++
I'm struggling with this one!
Still can't pass the "should_generate_passwords_without_bias" tests.
I'm pretty sure I'm respecting all criterias.
Anyone else having problems in C++ ? I can see that 6 people passed the test, so it has to be me, but still.. :/
Also could you clarify
"...all characters should have less than 50% occurance..."
What does that mean exaclty ?
Thanks for the help !
Hi guys, it's all good now, thx for the fix and nice kata !
Sorry but I still get inputs like
"X 9-420718074 9-530426026 X 3-828761311 0/ X X 6-763306470 53"
or
"9-215378899 0/ 0-1244287807 8/ 3-1649707229 9/ 4/ 3/ X 34"
or
"8/ 6/ 1/ 3/ 5/ 2/ 9/ X 1-452173253 XXX"
Still need some fixing!
JAVA
In random tests, I get inputs like
"5-1002388418 5-2133239090 1/ 8/ 7/ 6/ 8-1032947905 7/ 9-1633470296 12"
which expects a result of 306.
Looks like some issue in random digit generation ..
Your code is correct, except you obviously need to replace the "input" array with the actual input array named "array".
You got that, right ? :)
ps: oh, and you don't need your boolean :p
Can we see your code ? What you are saying is quite weird !
Hi OlalKeith,
So Math.sqrt(array[i]) is the square root of the array element...
Math.sqrt(array[i]) % 1 (or square root modulo 1)is the reminder of the square root, divided by 1.
If the result is 0, it means the square root is an integer.
ex:
Math.sqrt(16) = 4 --> 4 % 1 = 0 square root is an integer so the new element is the square root : 4
Math.sqrt(17) =~ 4.123 --> 4.123 % 1 =~ 0.123 square root is not an integer so the new element is the square : 17 * 17
+1 for updating description with your version :p
@author : nice kata though !
In the description it says "1 ≤ N ≤ 10^19" and yet, in the java version, the n parameter is an 'int' :p
ok cool. I'll wait for the fix to give this a good rating :)
Hello, nice kata !
I get some weird results sometimes though.
I'll name airports by their index in the given list.
Sometime, I find a route shorter that your solution but with an extra stop.
For example,
range : 6883
my route is : 91 -> 86 -> 163
distance : 6596 + 269 = 6865
expected route is : 91 -> 163
distance : 6866
I have manually checked, and the distanceTo method give these results.
Do you know how this could happen ?
I still passed the kata cause this does not always happen depending on random tests...
bump :p
Loading more items...