What's difference between my solution and codegym's. Mine gives error?
package en.codegym.task.pro.task05.task0510;
/*
Triangular array
*/
public class Solution {
public static int[][] result = new int[10][];
public static void main(String[] args) {
//write your code here
for(int i=0;i<result.length;i++){
result[i]=new int [i+1];
}
for(int j=0;j<result[j].length;j++){
for(int k=0;k<result[j].length;k++){
result[j][k]=j+k;
}
}
}
}