Your question is Sum Pairs with Variations. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Find the sum of two numbers in an array, then handle variations: duplicates, multiple valid pairs, frequency-sorted output, etc.
Asked in the interview round 1 stage. SCE technical interview 1.
Implement find_sum_pairs(nums, target). Return one entry [a, b, count] for every unique pair of values where a <= b and a + b == target. count is the number of distinct index pairs producing those values. Sort entries by descending count, then ascending a. Return an empty list when no pair exists.
def find_sum_pairs(nums, target):