Count pairs in an array that hold i+j= arr[i]+arr[j] - GeeksforGeeks
Given an array of integers arr[], the task is to count all the pairs (arr[i], arr[j]) such that i + j = arr[i] + arr[j] for all 0 ≤ i < j < n.
Note: Pairs (x, y) and (y, x) are considered a single pair.
Read full article from Count pairs in an array that hold i+j= arr[i]+arr[j] - GeeksforGeeks
No comments:
Post a Comment