Ad
  • Custom User Avatar

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

  • Custom User Avatar

    6 years later it looks like the (current) limit of 500 is fine

  • Custom User Avatar

    ruby random tests are giving wrong values, including the country name, e.g.

    "China" => "China,54,32,44"  # instead of just "54,32,44"
    
  • Custom User Avatar
  • Custom User Avatar

    Now let's create a kata for B... oh, wait

  • Custom User Avatar

    That is a list of precalculated results.

  • Custom User Avatar

    I thought |n| means the absolute value of n, but fine

  • Custom User Avatar

    This is just the end of the "small" random tests, "medium" and "large" are obviously larger:

    Random Tests
    Small
    
    [...]
    
    Log
    n='1000001001011110001011000000' (=136700608), k=3
    'Too big!' should equal 438933664
    
    Log
    n='1100001110000111111010001111111' (=1640232063), k=15
    'Too big!' should equal 321509065
    
    Log
    n='10111001001111110000011111000010010100' (=198906605716), k=12
    'Too big!' should equal 628816705
    
    Log
    n='100001000011000100001101110' (=69306478), k=9
    'Too big!' should equal 803835291
    
    Log
    n='101011110011110110000100011000011111' (=47040710175), k=26
    'Too big!' should equal 33423597
    
    Log
    n='101110001111000011011100100001001100' (=49644685388), k=13
    'Too big!' should equal 752500598
    
    Log
    n='100101000010100101110100001000010001000000' (=2545402545216), k=7
    'Too big!' should equal 46506382
    
    Log
    n='1001001110011110110101101111000100110000111001011' (=324620840493515), k=16
    'Too big!' should equal 747391858
    

    Under "large", it's even worse:

    ValueError: Exceeds the limit (4300) for integer string conversion; use sys.set_int_max_str_digits() to increase the limit
    
  • Custom User Avatar

    kthxbye

  • Custom User Avatar

    issues:

    • description says 1 ≤ ∣n∣ ≤ 10 which is wrong
    • example in description says n = 11 but "Note that n will be represented as a binary string"
  • Custom User Avatar

    Fine, I just need to read more attentively ;-)

  • Custom User Avatar
    "aa"   --> ""
    "aaa"  --> "a"
    "aaaa" --> ""
    "aabb" --> ""
    etc?
    
  • Custom User Avatar

    Shuffling integer can result in a number that is greater than the original

    My bad - looks like my mind skipped that part of the description...

    update: It may be a good idea to add this to the description

  • Custom User Avatar
  • Custom User Avatar

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

  • Loading more items...