message: Update arranging-coins.cpp
diff: @@ -13,15 +13,20 @@ public:
  class Solution2 {
  public:
  int arrangeCoins(int n) {
  - long long left = 1, right = n;
  + uint64_t left = 1, right = n;
  while (left <= right) {
  const auto mid = left + (right - left) / 2;
  - if (2L * n < mid * (mid + 1)) {
  + if (!check(mid, n)) {
  right = mid - 1;
  } else {
  left = mid + 1;
  }
  }
  - return left - 1;
  + return right;
  + }
  +
  +private:
  + bool check(uint64_t mid, uint64_t n) {
  + return mid <= 2L * n / (mid + 1);
  }
  };
  