Given an integer array , return the number of arithmetic subarrays. An arithmetic subarray is a sequence of at least three elements with constant difference.
For example, contains arithmetic subarrays: , , and .
This problem tests whether you recognize arithmetic sequences and can count continuous patterns. Think about what makes a subarray arithmetic.