Question 5: HR issues

HR issues InfTQ

HR issues

In this article we will see InfyTQ Sample Coding question. You will find solution of InfyTQ Coding question in different programming language on this page. 

Problem statement -:

Shovon is an HR in a renowned company and he is assigning people to work. Now he is assigning people work in a fashion where if he assigns somework a work of cost 2, the next person will be strictly getting a job with cost equal or more than 2. Given that Shovon’s company has infinite work and a number of employees, how many distributions can be possible. The cost of jobs can go 0 to 9.

Function Description:

Complete the special_numbers function in the editor below. It has the following parameter(s):

Parameters:

NameTypeDescription
NIntegerThe number of depts.
arr[ ]Integer arrayThe number of  employees in each dept..

Return:

The function must return an INTEGER denoting the sum of answers for all distinct distributions.

Constraints:

  • 1 <= n <= 100
  • 1 <= arr[i] <= 200

Sample Cases:

  • Sample Input 1

    2
    4
    1
  • Sample Output 1

    725
  • Description

    The ans if m = 1 is 1o, which is all numbers from 0 to 9
    The ans for m = 2 is 55
    The answer for m = 3 is 220
    The answer for m = 4 is 715
    So fun(4) + fun(1) = 725