Leetcode Symmetric Binary Relation