Ad
  • Default User Avatar

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

  • Default User Avatar

    I see it is using a perpetual Gregorian Calendar which makes pattern finding easier.

  • Default User Avatar

    I'm wondering about year 1000. When I look at this calendar https://www.timeanddate.com/calendar/?year=1000&country=1. It shows March 1000 as having an extended weekend. But in the sample test cases. It has no extended weekends for that year. It looks like the first month is from Aug 1001.Are we assuming perpetual Gregorian Calendar instead of changing to the Julian Calendar when appropriate?

  • Default User Avatar

    In javascript for input
    [ { type: 'red', distance: [ 50, -8 ] },
    { type: 'black', distance: [ 55, -7 ] },
    { type: 'red', distance: [ 82, -8 ] },
    { type: 'black', distance: [ 67, 9 ] },
    { type: 'black', distance: [ 90, -3 ] },
    { type: 'red', distance: [ 75, 2 ] },
    { type: 'jack', distance: [ 81, -5 ] } ]

    The expected result is 'red scores 2'.
    Accoring to my calculations the distance for the closest black ball and the 2nd closest red ball are identical therefore score should be 1.

  • Default User Avatar
  • Default User Avatar

    Failing all javascript random tests. All tests expect 0. Example:

    Testing for [[500, 189],[753571, 196],[68, 19773],[1159171, 637],[100, 45125]]

    Expected 0 got 830610180

    product - lcm is zero when there are no common factors

    100,45125 have a common factor of 5. Therefore sum should not be zero.

    Please explain why this logic is wrong.

  • Default User Avatar

    22 in the test Series is correct.
    Base Series 1,2,4,8.16,22
    Test Series 15,20 (first iteration) ,22 (2nd iteration)
    Number of iterations in the Test Series to Converge => 2
    You only count the number of iterations you need in the Test Series to get to a number in the Base Series.

  • Default User Avatar

    sorry - yes javascript.

  • Default User Avatar

    In JavaScript node 8.
    I'm having problems with the given bignumber library.
    It has no math functions so no way to add, multiply, check for LessThan, etc.

    I got the algorithm to work locally reasonably fast. But without math this is hard to solve.

  • Default User Avatar

    with random tests

    test Series starting with 94224

    I get expected 861 got undefined -

    It confused me that in the random tests the usual expected and got are reversed.

    Here expected is the value my function returns and got was what the value the program being used to test returns.

    On step 861 I am matching 3110832 with the original series.

    Since the testing function is returning undefined I think this is a bug?