Ad
  • Custom User Avatar

    Getting on average 10 error messages like:

    [61.0, 61.514828897338404, 62.02965779467681, 62.54448669201521, 63.05931558935361, 63.57414448669201, 64.08897338403042, 64.60380228136881, 65.11863117870722, 65.63346007604562, 66.14828897338403, 66.66311787072243, 67.17794676806083, 67.69277566539924,
    .....

    732.3368821292777, 732.851711026616, 733.3665399239544, 733.8813688212929, 734.3961977186312, 734.9110266159696, 735.4258555133081, 735.9406844106464, 736.4555133079848, 736.9703422053233, 737.4851711026616, 738.0]

    this is probably the result of my code, yet not what was expected

    How to get closer to what is expected ?
    is it really necessary to analyze this output to find out about the input ?

    The previous comments on precision seem not to be helpful, anyway.

  • Custom User Avatar

    You can check what are random inputs by yourself: https://docs.codewars.com/training/troubleshooting#print-input

  • Custom User Avatar

    My code works well with all delivered tests,
    yet the attempt-tests go wrong

    to debug, could s.o. give the attempt-input or some routine that creates
    random inputs please ?

    one of the following should be sufficient. The wronger the better

    {'pos': [1, 4, 8, 10, 14, 16, 19, 21],
    'peaks': [12, 15, 2, 10, 13, 13, 19, 15]}
    should equal
    {'pos': [1, 4, 6, 8, 10, 14, 16, 19, 21],
    'peaks': [12, 15, 0, 2, 10, 13, 13, 19, 15]}

    {'pos': [6, 11, 14, 18, 20, 22],
    'peaks': [18, 16, 18, 13, 10, 16]}
    should equal
    {'pos': [6, 11, 14, 18, 20, 22, 25],
    'peaks': [18, 16, 18, 13, 10, 16, 10]}

    {'pos': [2], 'peaks': [15]}
    should equal
    {'pos': [2, 5, 9, 12, 14],
    'peaks': [15, 18, 17, 19, 20]}

    {'pos': [2, 6, 10, 13],
    'peaks': [16, 13, 6, 4]}
    should equal
    {'pos': [2, 6, 10, 13, 16, 20, 22],
    'peaks': [16, 13, 6, 4, 13, 18, 17]}

    {'pos': [1], 'peaks': [5]}
    should equal
    {'pos': [1, 5, 9, 11, 13, 18],
    'peaks': [5, 9, 17, -1, 12, 16]}

    {'pos': [1, 5, 9], 'peaks': [20, 20, 20]}
    should equal {'pos': [1, 5, 9, 14, 16, 18],
    'peaks': [20, 20, 20, 16, 20, 10]}

    {'pos': [1, 5, 8, 11, 13],
    'peaks': [10, -1, 16, 11, 3]}
    should equal {'pos': [1, 5, 8, 11, 13, 16, 19],
    'peaks': [10, -1, 16, 11, 3, 20, 14]}

    {'pos': [1, 4, 7, 9, 13, 15],
    'peaks': [20, 9, 19, 11, 13, 18]}
    should equal
    {'pos': [1, 4, 7, 9, 13, 15, 18, 21, 24, 26, 28],
    'peaks': [20, 9, 19, 11, 13, 18, 11, 15, 19, 5, 15]}
    {'pos': [1, 3, 7],
    'peaks': [12, 11, 10]}
    should equal
    {'pos': [1, 3, 7, 12, 15, 17],
    'peaks': [12, 11, 10, 15, 10, 15]}

    {'pos': [5, 7, 9, 11],
    'peaks': [17, 13, 11, 11]}
    should equal
    {'pos': [5, 7, 9, 11, 15, 20],
    'peaks': [17, 13, 11, 11, 16, 17]}

    {'pos': [2, 4, 6],
    'peaks': [16, 12, 3]}
    should equal {'pos': [2, 4, 6, 11],
    'peaks': [16, 12, 3, 20]}

  • Custom User Avatar

    Please give a hint conc. "multiply"

    Should
    [1, 5],
    [2],
    [-1, -3]

    be treated as

    [1, 5],
    

    [2, 0],
    [-1, -3]
    ?

    "smallest" gives the imagination that there is some choice possible.
    This would be in contrast to simple vector multiplication, right ?

  • Custom User Avatar

    I do notunderstand the instructions
    Moreover:
    Is this

    [1, 5],
    [2],
    [-1, -3]

    to be underrstood as:

    [1, 5],
    [2, 0 ],
    [-1, -3]

    ?

    multiply the contents of each nested array

    appears to me like:

    a1*b1 + a2 * b2 + a3 *b3...

    but may as well be:

    a1b1c1 + a2b2c2
    ....

    But what menas:
    the "smallest" total ?

    in vector multiplication there is always a unique solution

  • Custom User Avatar

    Thanx, anyway my approach was more stupid. After changing print(changedstring) to return(changedstring) it works

  • Custom User Avatar
  • Custom User Avatar

    Its a bit strange, my code yields the desired test results, the ouput is a string (checked by type())
    but it is rejected. What went wromg ?
    Am I allowed to post the listing here ?
    Thanx

    Test Results:
    Log
    20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11
    None should equal '20 8 5 19 21 14 19 5 20 19 5 20 19 1 20 20 23 5 12 22 5 15 3 12 15 3 11'
    Log
    20 8 5 14 1 18 23 8 1 12 2 1 3 15 14 19 1 20 13 9 4 14 9 7 8 20
    None should equal '20 8 5 14 1 18 23 8 1 12 2 1 3 15 14 19 1 20 13 9 4 14 9 7 8 20'
    None should equal ''

  • Custom User Avatar
  • Custom User Avatar

    There are many more tests than ust "Welcome" as given in the instructions. Where to find them ?