Company: Visa_14feb
Difficulty: medium
Question 3 body { font-family: sans-serif; line-height: 1.6; } h1 { color: #333; } h2 { color: #555; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-top: 20px; } h3 { color: #777; margin-top: 15px; } code { background-color: #f0f0f0; padding: 2px 4px; border-radius: 3px; font-family: monospace; } ul { list-style-type: disc; margin-left: 20px; } ol { list-style-type: decimal; margin-left: 20px; } p { margin-bottom: 10px; } .example-block { background-color: #f9f9f9; border: 1px solid #ddd; padding: 15px; border-radius: 5px; margin-bottom: 20px; } Question 3 Problem Description A pair of integers (x, y) is perfect if both of the following conditions are met: min(x, y) + |x - y| >= 2 max(x, y) + |x - y| Given an array arr of length n , find the number of perfect pairs (arr[i], arr[j]) where 0 . Function Description Complete the function getPerfectPairsCount in the editor with the following parameters: Parameters: int arr[n] : an array of integers Returns: long : the number of p