← 返回 meta 的题目列表Sum of Elements Between Two Numbers
类型:online_judge
Given an unsorted integer array and two integers S and E, calculate the sum of all integers in the array that are greater than or equal to S and less than or equal to E.
Example:
Input: A = [3, 1, 4, 1, 5, 9, 2], S = 2, E = 5
Output: 12
Explanation: Elements 3, 4, 5, and 2 are within the range [2, 5], and their sum is 12.
Example
Input
3,1,4,1,5,9,2
2
5