0441.cpp (103B)
1 class Solution { 2 public: 3 int arrangeCoins(int n) const { return (sqrt(8l * n + 1) - 1) / 2; } 4 };