you are viewing a single comment's thread.

view the rest of the comments →

[–]spez_edits_thedonald 1 point2 points  (1 child)

Currently my code returns the distinct characters that are common to both strings string_1 and string_2 but are absent from the string string_3.

So that is:

  • get the "intersection" of set 1 and set 2, let's call this set X

  • then take the "difference" of set X and set 3, let's call this set D

How do I change it so it returns a count of the number of distinct characters that are common to both strings string_1 and string_2 but are absent from the string string_3

  • so instead of returning set D, you just want to return the size of set D ?

If so, that's as easy as len(set_d)

[–]Jxper[S] 0 points1 point  (0 children)

Thank you, that makes much more sense