For this Question: Given an array of N integers, your task is to find the maximum value of the sum of its subarray modulo M, i. e., find the sum of each subarray mod M and print the maximum value of this after modulo operation.The first line of input contains two space-separated integers N and M, the next line of input contains N space-separated integers depicting value of the array.

<b>Constraints:-</b>
1 < = N < = 100000
1 < = M < = 10000000000
1 < = Arr[i] < = 10000000000Print the maximum value of sum modulo m.Sample Input:-
5 13
6 6 11 15 2

Sample Output:-
12

Explanation:
[6, 6] is subarray is maximum sum modulo 13

Sample Input:-
3 15
1 2 3

Sample Output:-
6

Explanation:
Max sum occurs when we take the whole array, I have written this Solution Code: import java.io.*;
import java.util.*;

class Main {
	public static void main (String[] args)throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String[] s = br.readLine().split(" ");
		int N = Integer.parseInt(s[0]);
		int M = Integer.parseInt(s[1]);

		s = br.readLine().split(" ");
		int[] prefix = new int[N];
		int preSum = 0;
		for(int i=0; i<N; i++){
			int curr = Integer.parseInt(s[i]);
			preSum += curr;
			prefix[i] = preSum;
		}

		if(M>=prefix[N-1]){
			System.out.println(prefix[N-1]);
			return;
		}

		int maxSum = 0;
				for(int i=0; i<N; i++){
			for(int j=0; j<i; j++){

				int curr = prefix[i]%M;
				maxSum = Math.max(maxSum, curr);

				curr = (prefix[i]-prefix[j])%M;
				maxSum = Math.max(maxSum, curr);

				if(maxSum==M-1){
					break;
				}
			}
		}
		System.out.println(maxSum);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?