Update Main.java

Subtract 1 from the prefixLength when comparing to locationColor, b/c prefixLength is 1 larger than the location of the last char of strings.