<commit_before>#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>

using namespace std;

void bubblesort(vector<char>& vec) {
	int n = vec.size();

	// nest loops because O(n^2)
	// changes_made is an optimization that can reduce runtime in certain conditions
	bool changes_made = false;

	for (int i = 0; i < n - 1; i++) {

		for (int j = 0; j < n - 1; j++) {
			if (vec[j] > vec[j+1]) {

				// swap them
				char temp = vec[j];
				vec[j] = vec[j+1];
				vec[j+1] = temp;

				// tell program to run thru vec at least once more
				changes_made = true;
			}
		}

		// optimization to exit loop if no changes made
		if (!changes_made) break;

		changes_made = false;
	}
}

int main() {
	cout << "give me a string" << endl;
	string s; getline(cin, s);

	vector<char> vec(s.begin(), s.end());

	if (!vec.empty()) bubblesort(vec);

	string str(vec.begin(), vec.end());

	cout << str << endl;
	return 0;
}<commit_msg>mess with bubblesort<commit_after>#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>

using namespace std;

void bubblesort(vector<char>& vec) {
	int n = vec.size();
	char temp;

	for (int i = 0; i < n; i++) {

		for (int j = i+1; j < n; j++) {
			if (vec[i] > vec[j]) {

				temp = vec[i];
				vec[i] = vec[j];
				vec[j] = temp;

			}
		}
	}
}

int main() {
	cout << "give me a string" << endl;
	string s; getline(cin, s);

	vector<char> vec(s.begin(), s.end());

	if (!vec.empty()) bubblesort(vec);

	string str(vec.begin(), vec.end());

	cout << str << endl;
	return 0;
}
{'fraction_non_alphanumeric': 0.18075422626788037, 'fraction_numerical': 0.007802340702210663, 'mean_word_length': 3.1149732620320854, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 17, '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': '2438652', 'n_tokens_mistral': 661, 'n_tokens_neox': 580, 'n_words': 184}