mission-peace / interview

Interview questions
Apache License 2.0
11.08k stars 5.17k forks source link

Fix the variable name in matrix multiplication problem #281

Open jyj407 opened 4 years ago

jyj407 commented 4 years ago

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;