def _lcs_recur(s1, s2, n1, n2):
    """Helper function for longest_common_subsequence_recur()."""
    if n1 <= 0 or n2 <= 0:  # Base case.
        return 0
    
    if s1[n1 - 1] == s2[n2 - 1]:
        # If the current chars are the same, LCS is the last LCS plus 1.
        lcs = _lcs_recur(s1, s2, n1 - 1, n2 - 1) + 1
    else:
        # If not, LCS is the max of LCS's w/o current char of text1 or text2.
        lcs1 = _lcs_recur(s1, s2, n1 - 1, n2)
        lcs2 = _lcs_recur(s1, s2, n1, n2 - 1)
        lcs = max(lcs1, lcs2)
    
    return lcs