Nagarro interview question

intersection, union and som question on string