Sat Feb 05 2022 12:20:21 GMT+0000 (UTC)

```import java.util.*;
import java.io.*;

class Solution {
public static long sumUnderModulo(long a, long b){

long M = 1000000007;
// a+b mod M = (a mod M + b mod M)mod M
return  (a % M + b % M)%M;
}
}

class GFG
{
public static void main(String args[])throws IOException
{

//taking testcases

while(t-- > 0) {

//taking input a and b
Long a = Long.parseLong(str[0]);
Long b = Long.parseLong(str[1]);

//calling method sumUnderModulo()
System.out.println(new Solution().sumUnderModulo(a,b));
}
}
}```
content_copyCOPY

9. Addition Under Modulo Given two numbers a and b, find the sum of a and b. Since the sum can be very large, find the sum modulo 10^9+7. Example 1: Input: a = 9223372036854775807 b = 9223372036854775807 Output: 582344006 Explanation: 9223372036854775807 + 9223372036854775807 = 18446744073709551614. 18446744073709551614 mod (10^9+7) = 582344006 Example 2: Input: a = 1000000007 b = 1000000007 Output: 0 Explanation: 1000000007 + 1000000007 = (2000000014) mod (10^9+7) = 0 Your Task: You don't need to read input or print anything. Your task is to complete the function sumUnderModulo() that takes a and b as input parameters and returns sum of a and b under modulo 10^9+7. Expected Time Complexity: O(1) Expected Auxilliary Space: O(1) Constraints: 1 <= a,b <= 2^63 - 1