Most Unique Elements (Part 2 :)
The 2nd parameter (boolean) is to use Jaccard Similarity instead of most common character. Refactor your code to select the strings that have the lowest average Jaccard Similarity when compared to every other string if this parameter is True. If the parameter is false you should still calculate the lowest proportion in Part 1.
The rest of your code is the same as Part 1: return a string composed of the characters that are uniquely present in the selected strings across the entire list.
For this part, assume there’s a function imported that calculates the pair-wise jaccard similarity between two strings (returns a number between 0 and 1):
1 -> true; 0 -> false
Function Definition:
def jaccard(string1, string2):
return 0
Make sure the tests for Part 1 still pass.
Big thanks to the awesome friend who shared the source!
Hi~ There is no example test case coming with the source, so the example below is just a placeholder. The problem statement and function definition should give us a clear idea of what this problem is asking~