I know I am being picky. But to be honest, I really don't like people use l for varaible name meaning length, It is very easy to be misread as 1 especially for new starters. I have came accross this several times, I can tell the difference and find the problem quicker than before now. But for others purpose, we'd better fix the naming as either length or the len rather than just l. In general, I found a single char l for naming is very confusing. Thanks!
for(int l=2; l < arr.length; l++){
for(int i=0; i < arr.length - l; i++){
int j = i + l;