The Jaccard similarity coefficient measures how similar two sets are. For two sets A and B, the coefficient J(A,B) is the size of the intersection divided by the size of the union, that is J(A,B)=∣A∪B∣∣A∩B∣. For example, if A={1,3,7,8} and B={1,7,9}, then J(A,B)=∣{1,3,7,8,9}∣∣{1,7}∣=52.
Every element of a set is an integer between 0 and 9, and no set holds more than 10 elements. Given two sets A and B, compute J(A,B) and print 1 when J(A,B)>0.5, or 0 when J(A,B)≤0.5.