at first I added test from description:
@Test
public void testFirst() {
int[][] firstPyramid = new int[][]{
{3},
{7,4},
{2,4,6},
{8,5,9,3}
};
assertEquals(23, LongestSlideDown.longestSlideDown(firstPyramid));
}
For learning purpose will be good to add constructors to commented class TreeNode like this:
public static class TreeNode {
public int value;
public TreeNode left;
public TreeNode right;
Which language does not have that example test already?
This comment is hidden because it contains spoiler information about the solution
at first I added test from description:
@Test
public void testFirst() {
int[][] firstPyramid = new int[][]{
{3},
{7,4},
{2,4,6},
{8,5,9,3}
};
assertEquals(23, LongestSlideDown.longestSlideDown(firstPyramid));
}
this is very helpful thank you
For learning purpose will be good to add constructors to commented class TreeNode like this:
public static class TreeNode {
public int value;
public TreeNode left;
public TreeNode right;
}
fixed, thanx
Sorry, may be typo in description - not "euclidiean", but "euclidean". With all my respect.
"Efficiency is not a key point of this part of the series" - but I have time out - 16s and so many random tests(
I am not complain!)
Strange, 6 points for so easy task, as I see
This comment is hidden because it contains spoiler information about the solution
for Java, I change parameter in function from int to long. There is a test where num = -2147483648
Nice Kata. I solved this kata only when read about
"Little-endian" and "Big-endian".
Yes, this is the point! Thats why in IT companies Business analysts are working hard.
this also get pass.
Approved
Loading more items...