cswork / OAOpen practice workspace

SalesforceOA #14

Find Number of Perfect Pairs

Estimated MediumStatement and editorial — judging is being prepared

Topics (AI-labelled)Two PointersBits & MathBinary Search

Given an array, find the number of perfe

Constraints

n/a

Example 1

Input:

arr = [2, 5, -3]

Output:

2

Explanation: out of (2, 5) , (5, -3) and (2, -3), (2, -3) and (5, -3) satisfy both the conditions. Therefore, the output is 2.

Editorial

Loading solution…