NewProject Coding is here — build features and fix bugs in real codebases with an AI assistantSee what's new

Given two business names represented as strings s1 and s2, compute the Jaccard similarity index. The index is defined as the ratio between the number of common distinct words and the total number of distinct words from both strings. The result should be rounded to two decimal places. If both input strings are empty, return 1.0.

Constraints:

  • Each input string consists of words separated by one space.
  • Business names are case-sensitive.
Test Cases
Input
Output
Expected