We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Java 1D Array (Part 2)
Java 1D Array (Part 2)
Sort by
recency
|
618 Discussions
|
Please Login in order to post a comment
//Right code
return canWinFromPosition(leap, game, 0); }
pls follow for better code and message for the answer for all type language coding
My Solution: // Return true if you can win the game; otherwise, return false. if(index < 0 || game[index] == 1) { return false; } if(index +1 > game.length-1 || index + leap > game.length-1) { return true; } game[index] =1;
Does anyone else thinks this problem involves topics that should be covered before getting into it?
Seems to me that we are exiting the Java domain and entering into Dynamic Programming. Not that it's bad, but people just trying to learn will have difficulty covering this problems.