import java.util.*; public class Main { public static void main(String[] args) { // Write your code here int[] arr = {1,2,7,4,5}; boolean ans = sorted(arr, 0); System.out.print(ans); } public static boolean sorted(int[] arr,int index) { if(index == arr.length-1){ return true; } return arr[index]<arr[index+1] && sorted(arr, index+1); } }