Longest Uncommon Subsequence | CPP Program to find longest uncommon subsequence . ; function to calculate length of longest uncommon subsequence ; Case 1 : If strings are equal ; for case 2 and case 3 ; Driver code ; input strings
#include <iostream> NEW_LINE using namespace std ; int findLUSlength ( string a , string b ) { if ( ! a . compare ( b ) ) return 0 ; return max ( a . length ( ) , b . length ( ) ) ; } int main ( ) { string a = " abcdabcd " , b = " abcabc " ; cout << findLUSlength ( a , b ) ; return 0 ; }