package mooc3;
public class Test02 {
public static void main(String[] args) {
// TODO Auto-generated method stub
String s1="abce";
String s2="ced";
String temp=beautiful(s1, s2);
System.out.println(temp);
}
static String beautiful(String s1,String s2)
{ int count=-100;
for(int j=s2.length()-1;j>=0;j--)
{
String tmep=s2.substring(0,j+1);
System.out.println(tmep);
if (s1.lastIndexOf(tmep)+tmep.length()==s1.length())
{
count=j;break;
}
}
if(count==-100)
return s1+s2;
String ss=s1.substring(0,s1.length()-count-1);
return ss+s2;
}
}