• Sign Up
  • Kata
  • Kumite
  • Forum
  • Wiki
  • Leaders
  • Log In
  • Sign Up
Name:Unknown
Clan:15T
Member Since:Dec 2015
Last Seen:Dec 2020
Profiles:
Following:10
Followers:12
Allies:10
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations
  • Replies
  • Authored (16)
  • Needs Resolution
    • Frederikbh
    • commented on "Sum of Array Averages" javascript solution

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

    • Frederikbh
    • commented on "Minimum path in squares" csharp solution

    This solution would "just traverse down". The loops uses the destination coordinates to avoid unnecessary calculations.

    • Frederikbh
    • commented on "Minimum path in squares" kata

    X denotes the column of the endpoint, or the horizontal point if you will.

    Y denotes the row of the endpoint, or the vertical point if you will.

    With coordinates (0, 0) it should be obvious why the minimum path is 1, since you're starting and ending at the same position with the value 1.

    Here is the minimum path of the grid given before, when the endpoint is in (0, 1):

    [1,_,_],
    [4,_,_],
    [_,_,_]
    
    • Frederikbh
    • commented on "Minimum path in squares" kata

    You always start at the upper left corner. Then, each nested array represents a row in the 2D-grid.

    In the test-case you're referencing you're given the following grid:

    [1,2,3],
    [4,8,2],
    [1,5,3]
    

    The end coordinate is x = 0, y = 1, which is where the 4 is in the grid. Therefore the minimum path will be 1 + 4 = 5.

    • Frederikbh
    • commented on "Minimum path in squares" kata

    The problem with this approach is that you're calculating the cost of every possible path in the matrix. As you can imagine, that is quite a lot of possibilities. There is a much smarter way solve this problem, that gives you a running time of O(n^2) if the matrix is quadratic (Hint: Dynamic programming).

    • Frederikbh
    • commented on "Minimum path in squares" kata

    That's intentional as to not clutter the test cases.

    • Frederikbh
    • commented on "Minimum path in squares" kata

    The tests have been made in a way that requires you to come up with an implementation that runs pretty fast. (Hint: dynamic programming)

    • Frederikbh
    • commented on "Minimum path in squares" kata

    You're not always asked to move to the lower right corner. The goal-coordinated can be any point in the grid.

    • Frederikbh
    • commented on "Minimum path in squares" kata

    Oh yeah. That should be fixed now. I've allowed the very big squares to be reused, as it would take to long to copy them.

    • Frederikbh
    • commented on "Minimum path in squares" kata

    You're right. I've made the individual tests copy the original grid, to fix this. Thanks for pointing that out.

    • Frederikbh
    • resolved a question on "How far will I go?" kata

    Fixed.

    • Frederikbh
    • resolved an issue on "How far will I go?" kata

    I've changed the order now. Thanks for the feedback!

    • Frederikbh
    • commented on "How far will I go?" kata

    I really can't see where they're in the wrong order, please specify.

    assertEquals(java.lang.Object expected, java.lang.Object actual) 
              Asserts that two objects are equal.
    
    • Frederikbh
    • resolved an issue on "How far will I go?" kata

    Thanks for the feedback!
    I've added units to the input specifications.

    • Frederikbh
    • created an issue for "Palindrome-Generator" kata

    Missing test cases in Java

  • Loading more items...
  • © 2021 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm