Simple and easy to understand brute force solution in Java
Intuition\n Describe your first thoughts on how to solve this problem. \nThis is the brute force approach to this problem.\n# Approach\n Describe your approach 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nThis is the brute force approach to this problem.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nWe use a function solve to check in a specific range whether this subarray is in the arithmetic progression or not.\n# Complexity\n- Time complexity: O(n^2)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\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<l.length;i++){\n            int st=l[i];\n            int end=r[i];\n            if(solve(nums,st,end)){\n                ans.add(true);\n            } else {\n                ans.add(false);\n            }\n        }\n        return ans;\n    }\n    public boolean solve(int arr[],int l,int r){\n        // Arrays.sort(arr,l,r+1);\n        int[] smpl=new int[r-l+1];\n        for(int i=0;i<=r-l;i++){\n            smpl[i]=arr[i+l];\n        }\n        if(smpl.length<2){\n            return true;\n        }\n        Arrays.sort(smpl);\n        int d=smpl[1]-smpl[0];\n        for(int i=2;i<smpl.length;i++){\n            if(smpl[i]-smpl[i-1]!=d){\n                System.out.println("fcuk");\n                return false;\n            }\n        }\n        System.out.println("hlo");\n        return true;\n    }\n}\n```
['Java']