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
|
616 Discussions
|
Please Login in order to post a comment
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.
It says this is a 'NO' but I see it as a 'YES' from test case 1 after submit code
two jumps, right? or no?
import java.util.Scanner;
public class ArrayGame {
}