You are given an integer array nums representing the strength of various heroes.
The power of a nonempty group of heroes is defined as the product of the square of the maximum strength in the group and the minimum strength in the group. Specifically, for a group with maximum value
Return the sum of the powers of all nonempty groups of heroes. Since the answer may be very large, return it modulo
Constraints:
nums.length
nums[i]
You are given an integer array nums representing the strength of various heroes.
The power of a nonempty group of heroes is defined as the product of the square of the maximum strength in the group and the minimum strength in the group. Specifically, for a group with maximum value
Return the sum of the powers of all nonempty groups of heroes. Since the answer may be very large, return it modulo
Constraints:
nums.length
nums[i]