Python Solution with Explanation
Here in this code first we create a check function for checking whether the given array is arithmetic or not , whenever we pass an array through it. In which we
Here in this code first we create a check function for checking whether the given array is arithmetic or not , whenever we pass an array through it. In which we compare three values at a time for better understanding of the approach and question.\n\nThen in our main function checkArithmeticSubarrays , in this we take an empty list to store the values for each array ranges from left to right which we pass in each iteration.\n\nHere before calling the Check function we sort our array of corresponding range , coz after that only we can make sure and will be able to find an arithmetic subarray (one with equal differences between each corresponding pair of values).\n\nFor better understanding of each step plz...remove comments (symbol "#").\n```\nclass Solution:\n    def checkArithmeticSubarrays(self, nums: List[int], l: List[int], r: List[int]) -> List[bool]:\n        lst=[]\n        for i in range(len(l)):\n            #print(nums[l[i]:r[i]+1])\n            a=nums[l[i]:r[i]+1]\n            a.sort()\n            x=Solution().check(a)\n            #print(x)\n            lst.append(x)\n        return lst\n        \n    def check(self,arr):\n        if len(arr)==2:\n            return True\n        for i in range(1,len(arr)-1):\n            if arr[i]-arr[i-1]!=arr[i+1]-arr[i]:\n                return False\n        return True\n```\nIf u unerstood the code plz....UPVOTE....Thnx in advance.
['Python']