import java.util.Scanner;
public class InSearchOfAnEasyProblem {
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int j;
for(int i=0; i<n; i++){
j=sc.nextInt();
if(j==1){
System.out.println("HARD");
break;
}
}
if(j==0)
System.out.println("EASY");
}
}
This code doesn't compile, it is showing an error saying variable j might have not been initialized but we are taking input inside the loop even if it's multiple input in the same vairable it should have been just modified right? in that case shouldn't j hold the last input when it comes out of the loop?