Adding k to many elements in a sequence
I guess the problem is in the inner loop:

for(int j=0;j&lt;n;j++){
  if(j+1&gt;=a &amp;&amp; j+1&lt;=b){
    //...
  }
}


If 'n' value is big and the gap between 'a' and 'b' is small enough iterations will be useless most of the time.
Also in my opinion, using of int[] array is more suitable here.

You can try in this way:

public final class Solution {

  public static void main(String[] args) {
    final Scanner scanner = new Scanner(System.in);
    final int n = scanner.nextInt();
    final int m = scanner.nextInt();
    final int[] l = new int[n];

    for (int i = 1; i &lt;= Math.min(m, n - 1); i++) {
      final int a = Math.max(0, Math.min(scanner.nextInt() - 1, n - 1));
      final int b = Math.max(0, Math.min(scanner.nextInt(), n - 1));
      final int k = scanner.nextInt();
      for (int j = a; j &lt; b; j++) { // iteration in useful range
        l[j] += k;
      }
    }
    int total = l[0];
    for (int i = 1; i &lt; n; i++) {
      if (l[i] &gt; total) {
        total = l[i];
      }
    }
    System.out.println(total);
  }
}