arrangeCoins = function(n) {
  let discriminant = 1 + 8 * n;
  let sqrtDiscriminant = Math.sqrt(discriminant);

  let result1 = Math.floor((-1 + sqrtDiscriminant) / 2);
  let result2 = Math.floor((-1 - sqrtDiscriminant) / 2);

  return Math.max(result1, result2);
}
Math 
Time O(1) | Space O(1)
@param {number} n
@return {number}