We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Thanks to @szavgorodni, I realized we should also consider the count of equals. Commenting rocks!
selecta.x,a.yfrom(-- tuples with not equals that follow the ruleselectf1.x,f1.yfromfunctionsf1joinfunctionsf2on(f1.x=f2.yandf2.x=f1.yand(f1.x!=f1.y))andf1.x<f1.yunion-- tuples with the equals that follow the ruleselectf1.x,f1.yfromfunctionsf1joinfunctionsf2on(f1.x=f2.yandf2.x=f1.yand(f1.x=f1.y))groupbyf1.x,f1.yhavingcount(1)>1)aorderbya.xasc
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Symmetric Pairs
You are viewing a single comment's thread. Return to all comments →
Thanks to @szavgorodni, I realized we should also consider the count of equals. Commenting rocks!