JAVA solution:- Explained in HINDI
\nhttps://youtu.be/7DmLd0OPP8o?si=GyTpeRce9CWN_CjP\n\nGuys, check the above video for explanation, and do like and subscribe\n# Code\n\nclass Solution {\n    pu
\nhttps://youtu.be/7DmLd0OPP8o?si=GyTpeRce9CWN_CjP\n\nGuys, check the above video for explanation, and do like and subscribe\n# Code\n```\nclass Solution {\n    public List<Boolean> checkArithmeticSubarrays(int[] nums, int[] l, int[] r) {\n        List<Boolean> ans = new ArrayList();\n        for(int i = 0; i < r.length; i++) {\n            int arr[] = new int[r[i] - l[i] + 1];\n\n            for(int j = 0; j < arr.length; j++) {\n                arr[j] = nums[l[i] + j];\n            }\n            ans.add(isSafe(arr));\n        }\n        return ans;\n    }\n\n    public Boolean isSafe(int arr[]) {\n        Arrays.sort(arr);\n        int diff = arr[1] - arr[0];\n\n        for(int i = 2; i < arr.length; i++) {\n            if (arr[i] - arr[i-1] != diff) {\n                return false;\n            }\n        }\n        return true;\n    }\n}\n```
['Java']