<commit_before><commit_msg>hash table, good<commit_after>#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <string.h>
using namespace std;

/*
 * Hash table
 */
class Solution
{
public:
  //Insert one char from stringstream
    void Insert(char ch)
    {
    	tb[ch]++;
    	if (tb[ch] == 1) {
    		v.push_back(ch);
		} else {
			vector<char>::iterator it;
			it = find(v.begin(), v.end(), ch);
			if (it != v.end()) {
				v.erase(it);
			}
		}
    }
  //return the first appearence once char in current stringstream
    char FirstAppearingOnce()
    {
    	if (v.empty()) return '#';
    	else return v[0];
    }
private:
	unordered_map<char, int> tb;
	vector<char> v;
};
{'fraction_non_alphanumeric': 0.1596958174904943, 'fraction_numerical': 0.0025348542458808617, 'mean_word_length': 3.247311827956989, 'pattern_counts': {'":': 0, '<': 15, '<?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': '523060', 'n_tokens_mistral': 304, 'n_tokens_neox': 290, 'n_words': 75}