Longest Uncommon Subsequence | Java program to find longest uncommon subsequence using naive method ; function to calculate length of longest uncommon subsequence ; Case 1 : If strings are equal ; for case 2 and case 3 ; Driver code ; input strings
import java . io . * ; import java . util . * ; class GfG { static int findLUSlength ( String a , String b ) { if ( a . equals ( b ) == true ) return 0 ; return Math . max ( a . length ( ) , b . length ( ) ) ; } public static void main ( String [ ] args ) { String a = " abcdabcd " , b = " abcabc " ; System . out . println ( findLUSlength ( a , b ) ) ; } }