set operation str1-str2 on Strings

Set Theory operation on two strings
str1= apple

str1-str2 = (All elements of str1 which are not in str2)

Answer in above case = al


  1. First we can sort the strings and once they are sorted, I think we can find an efficient way. Will publish my solution there in my blog and will provide the link.

  2. @Tanmay yes this can be one of the efficient way..:)


Post a Comment

Popular posts from this blog