set operation str1-str2 on Strings

Set Theory operation on two strings
str1= apple
str2=pie

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

Answer in above case = al

Comments

  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.

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

    ReplyDelete

Post a Comment

Popular posts from this blog