<commit_before><commit_msg>arranging coins<commit_after>#include <vector>
#include <iostream>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <sstream>
#include <algorithm>
#include <queue>
#include <set>
#include <functional>
#include <stdio.h>
#include <stdlib.h>
using namespace std;

class Solution {
public:
	int arrangeCoins(int n) {
		if (n < 1) return 0;
		int i = 1;
		for (;;) {
			n -= i;
			if (n < i + 1) break;
			i += 1;
		}
		return i;
	}
};

int main() {
	cout << Solution().arrangeCoins(5) << endl; // 2
	cout << Solution().arrangeCoins(8) << endl; // 3

	cin.get();
	return EXIT_SUCCESS;
}

{'fraction_non_alphanumeric': 0.1732283464566929, 'fraction_numerical': 0.014173228346456693, 'mean_word_length': 4.0078740157480315, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4718461', 'n_tokens_mistral': 268, 'n_tokens_neox': 245, 'n_words': 67}