You are given an integer array nums and an integer x.
A contiguous subarray is considered valid if the sum of its elements satisfies both of the following conditions:
The most significant digit (first digit) of the sum is equal to x.
The least significant digit (last digit) of the sum is equal to x.
Return the total number of valid subarrays in nums.
Constraints:
nums.length
nums[i]
x
You are given an integer array nums and an integer x.
A contiguous subarray is considered valid if the sum of its elements satisfies both of the following conditions:
The most significant digit (first digit) of the sum is equal to x.
The least significant digit (last digit) of the sum is equal to x.
Return the total number of valid subarrays in nums.
Constraints:
nums.length
nums[i]
x