WHATS WRONG IN M,Y CODE?

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int m = scn.nextInt();
for (int I = 0; I < m; I++) {
int n = scn.nextInt();
int[] arr = new int[n];
for (int i = 0; i < arr.length; i++) {
arr[i] = scn.nextInt();
}
int max = Integer.MIN_VALUE;
for (int a = 0; a < arr.length; a++) {
int t = arr[a];
if (t > max)
max = t;
int s = 0;
for (int b = a + 1; b < arr.length; b++) {
s = t + arr[b];
if (s > max) {
max = s;
}
t = s;
}

		}
		System.out.println(max);
	}
}

}

@Harsh_Sonwani Hi buddy reviewing it!

@Harsh_Sonwani here it is bro the corrected code but ya it will give tle, i see you have used kadane before and it is highly efficient also but here is your corrected code. Mark the doubt resolved and rate full if you don’t have any query.

import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner scn = new Scanner(System.in);
int m = scn.nextInt();
for (int I = 0; I < m; I++) {
int n = scn.nextInt();
int[] arr = new int[n];
for (int i = 0; i < arr.length; i++) {
arr[i] = scn.nextInt();
}
int max = Integer.MIN_VALUE;
for (int a = 0; a < arr.length; a++) {
int s = 0;
for (int b = a; b < arr.length; b++) {
s = s + arr[b];
if (s > max) {
max = s;
}
}

		}
		System.out.println(max);
	}
}

}