You are given an integer array strength, where strength[i] denotes the strength of the
A group of wizards is defined as a non empty contiguous subarray of strength. The total strength of a group is defined as the product of:
The minimum strength among all wizards in the group.
The total sum of the strengths of all wizards in the group.
Return the sum of the total strengths of all contiguous groups of wizards.
Note: Since the answer may be very large, return it modulo
.
Constraints:
strength.length
strength[i]
You are given an integer array strength, where strength[i] denotes the strength of the
A group of wizards is defined as a non empty contiguous subarray of strength. The total strength of a group is defined as the product of:
The minimum strength among all wizards in the group.
The total sum of the strengths of all wizards in the group.
Return the sum of the total strengths of all contiguous groups of wizards.
Note: Since the answer may be very large, return it modulo
.
Constraints:
strength.length
strength[i]