about | help | code help+videos | done | prefs |
Given an array of N elements, the task is to find all the unique pairs that can be formed using the elements of a given array. Input: arr[] = {1, 1, 2} Output: 4 (1, 1), (1, 2), (2, 1), (2, 2) are the only possible pairs. numUniquePairs([1, 2, 3, 2, 4, 5, 4]) → 25 numUniquePairs([]) → 0 numUniquePairs([-3, 3]) → 4 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy