• ###### Frederikbhcommented on "Sum of Array Averages" javascript solution

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

• ###### Frederikbhcommented on "Minimum path in squares" csharp solution

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

• ###### Frederikbhcommented 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,_,_],
[_,_,_]
``````
• ###### Frederikbhcommented 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`.

• ###### Frederikbhcommented 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).

• ###### Frederikbhcommented on "Minimum path in squares" kata

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

• ###### Frederikbhcommented 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)

• ###### Frederikbhcommented 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.

• ###### Frederikbhcommented 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.

• ###### Frederikbhcommented 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.

Fixed.

• ###### Frederikbhresolved an issue on "How far will I go?" kata

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

• ###### Frederikbhcommented 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.
``````
• ###### Frederikbhresolved an issue on "How far will I go?" kata

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

• ###### Frederikbhcreated an issue for "Palindrome-Generator" kata

Missing test cases in Java