L [ i ] stores stores Weighted Job Scheduling of job [ 0. . i ] that ends with job [ i ]
ArrayList < ArrayList < Job > > L = new ArrayList < > ( ) ; for ( int i = 0 ; i < arr . size ( ) ; i ++ ) { L . add ( new ArrayList < > ( ) ) ; }