Available question text
Count pairs i<j where nums[i] + rev(nums[j]) == nums[j] + rev(nums[i]); the condition is equivalent to nums[i] - rev(nums[i]) == nums[j] - rev(nums[j]), so the task reduces to counting pairs of indices with the same transformed value and returning the result mod 1e9+7. Constraints: n up to 1e5 and nums[i] up to 1e9.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1814. Count Nice Pairs in an Array
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source