Array ( [0] => [1] => questions [2] => Strings [3] => Harmonic-Progression )
Given list of elements. You have to find the sum of elements which are in HP.
First line contains a number N. Next line contains N integers separated by spaces.
Print the resultant sum value.
5 1 1/2 1/3 1/4 1/5
2
7 1/2 1/4 1/6 1/8 1/10 1/12 1/14
1
5 1 1/4 1/7 1/10 1/13
2
Login to see Discussion
0
Note :
Let us know if you can come up with a better approach, mail us at support@theinquisitive.in Your approach will be reviewed and posted with credits to you.
Login to see Solution