longestPalindromicSubsequence.cpp
// this fn will return the length of LPS.

this fn will return the length of LPS.
this fn will return the length of LPS .
int findLPS(int startIndex, int endIndex){
	if(startIndex == endIndex) return 1;
	if(startIndex + 1 == endIndex && s[startIndex]==s[endIndex])
		return 2;
	if(s[startIndex] == s[endIndex])
		return 2+findLPS(startIndex+1, endIndex-1);
	return max(findLPS(startIndex+1,endIndex), findLPS(startIndex,endIndex-1));
}
int findLPS ( int startIndex , int endIndex ) { if ( startIndex == endIndex ) return 1 ; if ( startIndex + 1 == endIndex && s [ startIndex ] == s [ endIndex ] ) return 2 ; if ( s [ startIndex ] == s [ endIndex ] ) return 2 + findLPS ( startIndex + 1 , endIndex - 1 ) ; return max ( findLPS ( startIndex + 1 , endIndex ) , findLPS ( startIndex , endIndex - 1 ) ) ; }
this fn will return the length of LPS.
this fn will return the length of LPS .