Function in R to arrange coins in staircase.Task is to determine the number of complete rows of coins in the finished staircase : <p>Coins arrangement Example-
If there are 6 coins then a staircase with 1 coin in the top row, 2 in the second row &amp; 3 in the third row.So, in total 3 rows can be completed.To complete the 4th row, 4 more coins would be required i.e. in total 10 coins.</p>

<p><strong>Each row should have exactly one coin more than the row above it.</strong></p>

<p>I have to generate a function that arranges the coin such that, for each coins [k] function must print an integer denoting the max. no of complete rows that can be created.
Arranging coin has the following conditions-
1.coins[coins[0], -------coins[m-1] an array of long integers each representing the number of coins
2. m is in the range of 1 to 10^5.
3.coins[k] is in the range between 1 to 10^15.</p>
