• excellent kata :)

  • I was thinking on the same approach, good to know it might not be the most efficient. Now I am thinking of calculating the sum for each path at a time and compare its value the one from the previous path and keep the bigger one. There should be no problems of not having enough memory.

  • The instructions are not clear. I am not sure if that is part of the challenge or not. You must calculate the path that yields the greatest sum, but that path could include several smaller numbers on the way to a larger one for an overall higher score.

    So this
    1
    1 2
    9 7 6
    should yield 11, not 10, for a correct answer.

  • First, found maximum by each step and got 1064 instead 1074
    Second, found all possible ways and got 1074. 👌
    Third, got timeout. 🐸
    What if all numbers will be equal to 1 pluse one random in any place? 🚑

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

  • FArekkusu? Can watch my new kata please. Is it normal? And is it a plagiarism?
    https://www.codewars.com/kata/60bb73c6b3a07c00194367f4

  • I just realized that the solution is not being executed for the tests each time, since we have a simple int as solution. I see now why it doesn't affect anybody.
    Sorry for the inconvenience ^^

  • The solution that you've changed is the author's solution - a proof that the tests are working, it doesn't affect anybody in any way.

  • You're searching for a local maxima instead of the global one. Obvious mistake: in the second and third rows you pick 95 + 47 = 142 but you could pick 64 + 82 = 146; both paths lead you to 87 in the fourth row, and assuming this is the correct solution, your result is already off by 4 points. Read this comment in particular.

  • This has been discussed heavily in the comments below. There is one specific post that might resolve your problem.
    I hope this helps ^^

  • I need 1074 but got 75+95+47+87+82+75+73+28+83+47+43+73+91+67+98=1064.So where I make wrong turn?
    ["75"]
    ["95", 64]
    [17, "47", 82]
    [18, 35, "87", 10]
    [20, 4, "82", 47, 65]
    [19, 1, 23, "75", 3, 34]
    [88, 2, "77", 73, 7, 63, 67]
    [99, "65", 4, 28, 6, 16, 70, 92]
    ["41", 41, 26, 56, 83, 40, 80, 70, 33]
    [41, "48", 72, 33, 47, 32, 37, 16, 94, 29]
    [53, "71", 44, 65, 25, 43, 91, 52, 97, 51, 14]
    ["70", 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57]
    ["91", 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48]
    [63, "66", 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31]
    [4, 62, "98", 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23]

  • Why hasn't this been added yet? :o This was the key example for me.

  •                             ["75"]
                              ["95", 64]
                            [17, "47", 82]
                          [18, 35, "87", 10]
                        [20, 4, "82", 47, 65]
                      [19, 1, 23, "75", 3, 34]
                    [88, 2, "77", 73, 7, 63, 67]
                  [99, "65", 4, 28, 6, 16, 70, 92]
               ["41", 41, 26, 56, 83, 40, 80, 70, 33]
             [41, "48", 72, 33, 47, 32, 37, 16, 94, 29]
           [53, "71", 44, 65, 25, 43, 91, 52, 97, 51, 14]
         ["70", 11, 33, 28, 77, 73, 17, 78, 39, 68, 17, 57]
       ["91", 71, 52, 38, 17, 14, 91, 43, 58, 50, 27, 29, 48]
     [63, "66", 4, 68, 89, 53, 67, 30, 73, 16, 69, 87, 40, 31]
    [4, 62, "98", 27, 23, 9, 70, 98, 73, 93, 38, 53, 60, 4, 23]
    

    Below 75 in sixth line you can move only to 73 or 7

  • Loading more items...