 # TNP Challenge 2.2 Harrys Array (TNP2_202) Editorial

TNP ARRAY A AND INTEGER K SOLUTION APPROACH:
To obtain the solution we want to compare the sum of k and the
element in the particular position (whose validity is to be determined
) with the sum of other elements in the array A .
To find the sum of other elements first we take the sum of all the
elements in the array and subtract the particular element from it
(whose validity is to be determined ).
After comparing if the sum of k and the element in the particular
position (whose validity is to be determined ) is greater or equal to
the sum of other elements in the array A , then it is counted as a
valid position .
Example:
N= 3 , K= 2
Array elements are 1 , 4 , 2
Here the sum of array elements is 7 . So it is subtracted with the
respective elements ( 1 , 4 , 2) and we get ( 6, 3, 5).
It is compared with the respective elements (k+1 ,k+4,k+2) = (3,6,4).
Here only in the second position (6>3) the sum of k and the element
in the particular position (whose validity is to be determined ) is
greater or equal to the sum of other elements in the array A . It is
valid and counted . So the output is one .