The width of a sequence is defined as the difference between its maximum and minimum elements.
Given an integer array nums, return the sum of the widths of all non empty subsequences of nums.
Note: Since the final answer can be very large, return it modulo
.
Constraints:
nums.length
nums[i]
The width of a sequence is defined as the difference between its maximum and minimum elements.
Given an integer array nums, return the sum of the widths of all non empty subsequences of nums.
Note: Since the final answer can be very large, return it modulo
.
Constraints:
nums.length
nums[i]