<commit_before>import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;

public class Day5 {

	public static int partOne(List<String> list) {
		String[] bad = { "ab", "cd", "pq", "xy" };
		int count = 0;
		
		outer: for (String s : list) {
			if (s.chars().filter(x -> x == 'a' || x == 'i' || x == 'o' || x == 'e' || x == 'u').count() < 3) {
				continue;
			}

			boolean check = false;
			for (int i = 0; i < s.length() - 1; i++) {
				if (s.charAt(i) == s.charAt(i + 1)) {
					check = true;
					break;
				}
			}
			if (!check)
				continue;

			for (String b : bad) {
				if (s.contains(b))
					continue outer;
			}

			count++;
		}
		return count;
	}

	public static int partTwo(List<String> list) {
		int count = 0;
		for (String s : list) {
			boolean check = false;
			for (int i = 0; i < s.length() - 1; i++) {
				String curr = s.substring(i, i + 2);
				if (s.substring(i + 2).contains(curr)) {
					check = true;
					break;
				}
			}
			if (!check)
				continue;

			check = false;
			for (int i = 1; i < s.length() - 1; i++) {
				if (s.charAt(i - 1) == s.charAt(i + 1)) {
					check = true;
					break;
				}
			}

			if (!check)
				continue;

			count++;
		}
		return count;
	}

	public static void main(String[] args) throws IOException {
		List<String> s = Files.readAllLines(Paths.get("./input/Day5_input.txt"));
		System.out.println("Part One = " + partOne(s));
		System.out.println("Part Two = " + partTwo(s));
	}
}<commit_msg>RegEx are fun!<commit_after>import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.regex.Pattern;

public class Day5 {

	public static int partOne(List<String> list) {
		int count = 0;
		for (String s : list) {
			if (!Pattern.matches("(.*[aeiou]){3}.*", s))
				continue;

			if (!Pattern.matches(".*(.)\\1.*", s))
				continue;

			if (Pattern.matches(".*(ab|cd|pq|xy).*", s))
				continue;

			count++;
		}
		return count;
	}

	public static int partTwo(List<String> list) {
		int count = 0;
		for (String s : list) {
			if (!Pattern.matches(".*(..).*\\1.*", s))
				continue;

			if (!Pattern.matches(".*(.)\\w\\1.*", s))
				continue;

			count++;
		}
		return count;
	}

	public static void main(String[] args) throws IOException {
		List<String> s = Files.readAllLines(Paths.get("./input/Day5_input.txt"));
		System.out.println("Part One = " + partOne(s));
		System.out.println("Part Two = " + partTwo(s));
	}
}
{'fraction_non_alphanumeric': 0.19558232931726907, 'fraction_numerical': 0.00963855421686747, 'mean_word_length': 2.657856093979442, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 10, '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': '7409759', 'n_tokens_mistral': 1121, 'n_tokens_neox': 926, 'n_words': 234}