https://romankurnovskii.com/en/tracks/algorithms-101/leetcode/medium/2364/
2364. Count Number of Bad Pairs