See More

import java.util.Scanner; public class Challenge { static boolean isLeapYear(int n) { if (n % 100 == 0) { return (n % 400) == 0; } else { return n % 4 == 0; } } static int numLYunsorted(int[] a){ int count=0; for (int j : a) { if (isLeapYear(j)) { count++; } } return count; } public static void main(String[] args){ Scanner sc = new Scanner(System.in); System.out.println("Enter the Lower and Upper range."); System.out.print("\nlower range:"); int l=sc.nextInt(); System.out.print("upper range:"); int u=sc.nextInt(); // int res1=numLYrange(l,u); System.out.println("Enter no. of years in the sorted list:"); int n=sc.nextInt(); int[] arry = new int[n]; System.out.println("Enter the list of years:"); for(int i=0;i