
nums 순회function countSubarrays(nums: number[]): number {
let count = 0
for(let i = 0; i <= nums.length - 3; i++) {
const [first, second, third] = nums.slice(i, i + 3)
if((first + third) * 2 === second) count++
}
return count
};