mission-peace/interview

Questions about lcs implementation

drawnwren opened this issue · 0 comments

Hi, sorry to spam your github. Thanks for your videos and code. They're very helpful.

    ...
   deleted code
    ...
                else
                {
                    temp[i][j] = Math.max(temp[i][j-1],temp[i-1][j]);
                }
                if(temp[i][j] > max){
                    max = temp[i][j];
                }
            }
        }
        return max;
    
    }

In your video, you said that the lower right of the matrix should always be the max. That makes sense to me, so I was curious why you used this max variable to track the max?