Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Well, I'm not sure if by "brute force" you meant the wikipedia method, but it worked pretty well :p

    Nice kata

  • Custom User Avatar

    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 !

  • Custom User Avatar

    Hi guys, it's all good now, thx for the fix and nice kata !

  • Custom User Avatar

    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!

  • Custom User Avatar

    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 ..

  • Custom User Avatar

    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

  • Custom User Avatar

    Can we see your code ? What you are saying is quite weird !

  • Custom User Avatar

    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

  • Custom User Avatar

    +1 for updating description with your version :p

    @author : nice kata though !

  • Custom User Avatar

    In the description it says "1 ≤ N ≤ 10^19" and yet, in the java version, the n parameter is an 'int' :p

  • Custom User Avatar

    ok cool. I'll wait for the fix to give this a good rating :)

  • Custom User Avatar

    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...

  • Custom User Avatar
  • Loading more items...