Ad
  • Custom User Avatar

    Hi, I'm trying to resolve this in Javascript, whenever I try submiting, Random test and Performance testing fail.

    If i remove all the walls from the Grid, the performance test passes.

    anyone knows why this is ?

  • Default User Avatar

    Thanks, I've updated the test cases as suggested!

  • Default User Avatar

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

  • Custom User Avatar

    My solution on C# passed for any tests but failed on performance and random tests. And always result different for 1 (Expected: 405
    But was: 404 for example). Whats wrong with this tests?

  • Custom User Avatar
  • Custom User Avatar

    Fixed C# version.

  • Custom User Avatar
  • Default User Avatar
  • Default User Avatar
  • Default User Avatar

    Thx for the approval. :)

    Java tests updated!

    I did move your solution in the test case too: it's not a good idea to put the solution in the preloaded part, generally. (btw: your solution is really efficient! But mine is shorter and more general... ;p (The guy who searches for comfort where he can... ;o ))

    I let the issue open, waiting on modifications of JS and C#.

    Cheers,

    B4B

  • Default User Avatar

    Hey, thanks for the python translation!
    Your suggestions sound good and hopefully I'll have time to implement them on the weekend,
    but feel free to update the test cases for Java if you feel like it :)
    That might actually be a big help since I'm not as familiar with Python, meaning the Java test cases may be a good reference for me when applying the necessary changes to C# and JS..
    Cheers and happy coding!

  • Default User Avatar

    Hi,

    Several things here...

    First: Python translation (Might need a moderator for approval: the original author has not been connected this month. But maybe he will come back. Who knows... ;) )

    • description has been fixed and the figures in the description are now matching the grids of the tests
    • I made the performance test a real performance test (see below)
    • added 20 random tests instead of just one
    • added 3 new fixed tests with some important edge cases

    Now, the issue part (coming from Java):

    • the performance test has good chances to NOT be demanding: the starting point is chosen randomly on the full height of the grid, so if it begins "high" (talking about the index value), that's not demanding at all. So, need limitation of the value of the starting row.
    • needs real random tests, not just one (2 actually, with the performance test. But that's not enough...)
    • needs REAL random tests: the block frequency you choose is too high! On a bunch of 20 random grids, I found none where it cas possible to reach the last line so answer is always 0 for this test, currently. => I used 20% for the block frequency threshold, as for the performance test.

    I strongly suggest to update the test cases in each languages so that they match the tests I implemented in the python translation.

    Cheers,

    B4B

    Note: if the author doesn't show up and a moderator approve the python version, I'll update the Java version myself. But someone will have to do the JS and C# versions.

  • Default User Avatar

    Nice one!

  • Custom User Avatar

    PHP Translation Kumited - please accept :D

  • Default User Avatar

    Cool, thanks a lot! I've lowered the range of the values in the random test case to reflect the [-100, 100] range in the description and added the three example test cases to the Ruby version :)

  • Loading more items...