cswork / OA打开练习工作台

SalesforceOA #14

Find Number of Perfect Pairs

估计中等评测数据准备中,可先阅读题面

考点(AI 标注)双指针滑窗位运算二分查找

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.