Company: Amazon_1oct
Difficulty: medium
Distinct Stock Profit Pairs Problem Description A financial analyst for Amazon Web Services (AWS) is responsible for a portfolio of profitable stocks represented by an array. Each item in the array represents the yearly profit of a corresponding stock. The Amazonian gathers all distinct pairs of stocks that yielded the target profit. Distinct pairs are pairs that differ in at least one element. Given the array of profits, find the number of distinct pairs of stocks where the sum of each pair's profits is exactly equal to the target profit. Complete the function getDistinctPairs in the editor below. getDistinctPairs has the following parameter(s): int stocksProfit[n] : an array of integers representing the stocks profits target : an integer representing the yearly target profit Returns: int : the total number of pairs determined The function signature is: int getDistinctPairs(vector<int> stocksProfit, long target) Examples Example 1: Input: stocksProfit = [5, 7, 9, 12, 11, 6, 6, 3