Count No Of Bad Pairs Leetcode Sql