athenahealth Interview Question

They told me to write a string program which will compare two strings(a sentence without spaces) and come with a common word(present in both the string) as output.