Most Unknown Elements (Part 3 :)

If time allows, the company'd like us to finish Part 3 :)

Implement the jaccard function.

The Jaccard Similarity is a pair-wise comparison calculated with the formula:

jaccard(A, B) = intersection(A, B) / union(A, B)

The intersection is the set of characters that are present in both strings together, including repeats.

The union is the smallest set that contains all characters found in either string, including repeats.

Thanks a ton to the kind soul who shared the source!

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: