For Loop
Given two integers low and high, return the sum of all integers from low to high inclusive.
Example 1:
Input: low = 1, high = 5
Output: 15
Explanation: 1 + 2 + 3 + 4 + 5 = 15
Example 2:
Input: low = 3, high = 7
Output: 25
Explanation: 3 + 4 + 5 + 6 + 7 = 25
Now Your Turn!
Pick the correct output for the given inputInput: low = 3, high = 8
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 0 <= low <= high <= 100