6 kyu

Routes in a square grid

177 of 581NaMe613
Description
Loading description...
Fundamentals
Puzzles
  • Please sign in or sign up to leave a comment.
  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • FArekkusu Avatar

    Python 3 should be enabled.

  • marbiru Avatar

    It's probably too late to do anything but this is quite similar to https://www.codewars.com/kata/paths-in-the-grid -- same solution works with only very minor tweaks

  • jos0409007 Avatar

    can you help me please . i don´t know what i have to do yet... (tell me what i need to know)

  • korvintorson Avatar

    Maybe there are too much random tests for clojure. My solution passes 68 tests but it takes more than 10000ms and so overall execution fails.

  • FrizzBolt Avatar

    You should mention in the description that you can only move down or right by an increment of 1 at a time. When you mentioned that the side length was n, I first thought you meant the increment I could travel by was n which would mean just about everything is 2. The examples cleared that up. Haha.

  • youngmanr Avatar

    I wrote my solution as a recursive algorithm and for very large squares the run time exceeds the limit.

    Presumably you're after a non recursive solution?

  • vahid5695 Avatar

    Hi I wrote my code and it passes the test cases but while submitting the code, it says that there is something wrong with the code. So is there any difference between "submit" button and "run test" button? Why the code passes the test but i cant submit it?

  • SleepingCode Avatar

    This comment has been hidden.

  • bkaes Avatar

    This comment has been hidden.

  • GiacomoSorbi Avatar

    Translated into JS (with smaller ranges, due to problems in handling number precision in said language) and thanks for bringing me back fond memories of a nice problem I found on Euler a while ago and that took me a while to solve :)

  • bkaes Avatar

    Why does the user need to return None if there isn't any route? Isn't 0 sufficient? Keep in mind that some languages don't have dynamic types, and returning null instead of an int in Java is a little bit awkward.

    Better change the result to 0 if the argument is non-positive.

  • bkaes Avatar

    Don't put your solution in the preloaded sections! Some languages allow you to show the currently defined variables, and then it's as simple as user_solution = predefined_solution.

  • Unnamed Avatar

    Python tests (and example tests) do not work.