Ad
  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    The number of tests should be increased (this incorrect solution may pass all tests occasionally). I also recommend to add small random tests (random 10 x 10 matrices).

  • Default User Avatar

    Potentially add some random tests of a smaller grid size? My earlier solutions passed all fixed tests but failed some random, and it is difficult to debug when the grids are too large to output.

  • Custom User Avatar

    Hard coding 200_000? Better to keep working on your solution until it does the job within the given time.

  • Default User Avatar

    Sorry, I missed something in description. Nice kata!

  • Custom User Avatar

    210 - 158 = 52 > 35, so the second row is not harmonious.

  • Default User Avatar

    Please, test this:

    assert.strictEqual(HarmoniousArray([ [ 219, 165, 229, 164, 207, 182, 186, 134, 188 ],
      [ 215, 208, 161, 222, 191, 135, 175, 155, 131 ],
      [ 146, 205, 229, 203, 223, 153, 139, 221, 212 ],
      [ 140, 158, 184, 210, 134, 160, 182, 214, 153 ],
      [ 172, 145, 226, 170, 156, 197, 146, 204, 208 ] ], 35), 5)
    });
      
    It should be 6 heads.
    
    [[205, 229, 203],
    [158, 184, 210]]
    
    Thanks.
    
  • Custom User Avatar

    I have been trying to come up with a purely functional solution to this kata, but at last I have to turn to lodash for the deep merge.

    Anybody knows how to figure this nicely without using lodash?