int mod=1e9 +7;
int rev(int n)
{
int ans=0;
while(n)
{
ans= ans*10 + n%10;
n=n/10;
}
return ans;
}
int countNicePairs(vector<int>& nums) {
unordered_map<int,int>m;
int ans=0;
for(int i=0;i<nums.size();i++)
{
nums[i]-=rev(nums[i]);
m[nums[i]]++;
}
for(auto x: m)
{
cout<<x.first<<" : "<<x.second<<endl;
ans = ans %mod + (((long)x.second*(long)(x.second-1))/2) % mod;;
}
return ans%mod;
}