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.
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int q = scan.nextInt();
while (q-- > 0) {
int n = scan.nextInt();
int leap = scan.nextInt();
visited=new int[n];
int[] game = new int[n];
for (int i = 0; i < n; i++) {
game[i] = scan.nextInt();
}
hank you so much for this. I was into this issue and tired to tinker around to check if its https://plex.software possible but couldnt get it done. Now that i have seen the way you did it, thanks guys
with
regards
Thanks for sh https://kodi.software/ aring.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.
As hybrid application development with the mobile industry has a steady rise, mobile application development has become increasingly competitive. The pervasiveness of mobile devices and the widespread use of mobile applications among the global population has made smartphones a perfect avenue through which businesses can interact with their customers and clients. Companies can offer their products and services via mobile apps and significantly increase their customer base. As a result, the role of mobile application development in driving the growth of businesses has never been more important.
Java 1D Array (Part 2)
You are viewing a single comment's thread. Return to all comments →
Can you please tell me what is the wrong with my code
public static boolean canWin(int leap, int[] game) { // Return true if you can win the game; otherwise, return false. int i=0; int n=game.length; while(i < n) { if((i+leap<=n-1 && game[i+leap]==0) || i+leap==n-1) i=i+leap; else if((i+1<=n-1 && game[i+1]==0) || i+1==n-1) i=i+1; else if( i-1 >=1 && game[i-1]==0 ) i=i-1; else return false; if (i==n-1) return true; } return true;}
import java.util.; import java.io.;
class Solution{ public static void main(String []argh){ int[][] arr = new int[10][10]; Scanner sc = new Scanner(System.in); for(int i=0;i<6;i++){ for(int j=0;j<6;j++){ arr[i][j]=sc.nextInt();
}
import java.util.*;
public class Solution {
static int visited[];
public static boolean canWin(int[] game,int leap,int i) { // Return true if you can win the game; otherwise, return false.
} public static void main(String[] args) { Scanner scan = new Scanner(System.in); int q = scan.nextInt(); while (q-- > 0) { int n = scan.nextInt(); int leap = scan.nextInt(); visited=new int[n]; int[] game = new int[n]; for (int i = 0; i < n; i++) { game[i] = scan.nextInt(); }
} }
hank you so much for this. I was into this issue and tired to tinker around to check if its https://plex.software possible but couldnt get it done. Now that i have seen the way you did it, thanks guys with regards
Thanks for sh https://kodi.software/ aring.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.
As hybrid application development with the mobile industry has a steady rise, mobile application development has become increasingly competitive. The pervasiveness of mobile devices and the widespread use of mobile applications among the global population has made smartphones a perfect avenue through which businesses can interact with their customers and clients. Companies can offer their products and services via mobile apps and significantly increase their customer base. As a result, the role of mobile application development in driving the growth of businesses has never been more important.