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

public class Day21 {

	private static int solve(List<String> s, boolean loose) {
		int[] boss = parseBoss(s);
		int minGold = Integer.MAX_VALUE;
		int maxGold = Integer.MIN_VALUE;
		for (int weapon = 0; weapon < Fighter.weapons.length; weapon++) {
			for (int armor = 0; armor < Fighter.armors.length; armor++) {
				for (int lring = 0; lring < Fighter.dmg_rings.length + Fighter.armor_rings.length; lring++) {
					for (int rring = 0; rring < Fighter.dmg_rings.length + Fighter.armor_rings.length; rring++) {
						if (lring != 0 && lring == rring)
							continue;
						Fighter me = new Fighter(100, weapon, armor, lring, rring);
						if (simulate(me, boss.clone()))
							minGold = Math.min(minGold, me.cost);
						else
							maxGold = Math.max(maxGold, me.cost);
					}
				}
			}
		}
		return loose ? maxGold : minGold;
	}

	private static int[] parseBoss(List<String> s) {
		int[] boss = new int[3];
		for (int i = 0; i < boss.length; i++)
			boss[i] = Integer.valueOf(s.get(i).split(":")[1].trim());
		return boss;
	}

	private static boolean simulate(Fighter me, int[] boss) {
		return Math.ceil(me.hp / Math.max(1.0f, boss[1] - me.getDef())) >= Math
				.ceil(boss[0] / Math.max(1.0f, me.getAtt() - boss[2]));
	}
<commit_msg>Day 21 - LESS IS MOAR<commit_after>import java.io.IOException;
import java.nio.file.*;
import java.util.List;

public class Day21 {

	private static int solve(List<String> s, boolean loose) {
		int[] boss = parseBoss(s);
		int minGold = Integer.MAX_VALUE;
		int maxGold = Integer.MIN_VALUE;
		for (int weapon = 0; weapon < Fighter.weapons.length; weapon++)
			for (int armor = 0; armor < Fighter.armors.length; armor++)
				for (int lring = 0; lring < Fighter.dmg_rings.length + Fighter.armor_rings.length; lring++)
					for (int rring = 0; rring < Fighter.dmg_rings.length + Fighter.armor_rings.length; rring++) {
						if (lring != 0 && lring == rring)
							continue;
						Fighter me = new Fighter(100, weapon, armor, lring, rring);
						boolean won = Math.ceil(me.hp / Math.max(1.0f, boss[1] - me.getDef())) >= Math
								.ceil(boss[0] / Math.max(1.0f, me.getAtt() - boss[2]));
						if (won)
							minGold = Math.min(minGold, me.cost);
						else
							maxGold = Math.max(maxGold, me.cost);
					}
		return loose ? maxGold : minGold;
	}

	private static int[] parseBoss(List<String> s) {
		int[] boss = new int[3];
		for (int i = 0; i < boss.length; i++)
			boss[i] = Integer.valueOf(s.get(i).split(":")[1].trim());
		return boss;
	}

{'fraction_non_alphanumeric': 0.1626552795031056, 'fraction_numerical': 0.016304347826086956, 'mean_word_length': 3.1699029126213594, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 9, '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': '3045990', 'n_tokens_mistral': 1116, 'n_tokens_neox': 929, 'n_words': 237}