Amazon interview question

Compare versions in the two strings.