2009 FRQ 3B

public int getChargeStartTime(int chargeTime)
{
  int cheapestStartHour = 0;
  
  for(int startHour = 1; startHour < rateTable.length; startHour++)
    if(getChargingCost(startHour, chargeTime) <
          getChargingCost(cheapestStartHour, chargeTime))
      cheapestStartHour = startHour;
  
  return cheapestStartHour;
}

2017 FRQ 1b

import java.util.*;

public class Digits {
    private ArrayList<Integer> digitList;

    public Digits(int num) {
        digitList = new ArrayList<Integer>();

        if (num==0){
            digitList.add(new Integer(0));
        }
        while (num > 0) {
            digitList.add(0, new Integer(num % 10));
            num /= 10;
        }

    }

    public boolean isStrictlyIncreasing() {
        boolean increase = true;

        for (int i = 0; i < digitList.size() - 1; i++) {
            if (digitList.get(i).intValue() >= digitList.get(i + 1).intValue()) {
                increase = false;
                return increase;
            }
        }
        return increase;
    }
}

System.out.println(new Digits(1356).isStrictlyIncreasing());
System.out.println(new Digits(1536).isStrictlyIncreasing());
true
false

2019 FRQ 3B

public boolean isBalanced(ArrayList<String> delimiters) {
	int openDels = 0;
	int closeDels = 0;
	
	for (String del : delimiters) {
		if (del.equals(openDel)) {
			openDels++;
		} else {
			closeDels++;
		}
		
		if (closeDels > openDels) {
			return false;
		}
	}
	
	return openDels == closeDels;
}