Uber | Online Assessment
Anonymous User
2400
  1. Given a positive integer return result of product - sum.
    Integer (1>=n <=10^6)
    For example:
    Input : 123456
    product = 720
    sum = 21
    Output : 699

  2. Given an array a of non-negative integers, find the number of distinct pairs of integers for which the sum is equal to k.
    For example : k =8 and a =[2,3,6,2,8], the output should be 1 as [2,6] is the only distinct unique pair.

Comments (6)