The problem can be solved by breaking it up into two pieces. First, obviously we're going
to need a method to determine if a character is a consonant or vowel. This is
handled by isVowel(). isVowel() first converts the character to upper-case, and then
compares it to the standard vowels A, E, I, O, and U. If it matches one of these, or if
it doesn't and also is not a 'Y' then we're done. 'Y's are the only tricky letter.

To determine if 'Y' is a vowel or not, isVowel() requires a boolean denoting whether
the previous character was a vowel or not. We can set prevIsVowel's initial value to true
since the behavior of a 'Y' at the beginning of a string is the same as a 'Y' following
a vowel.

With a reliable method of determining consonants and vowels, we just need to construct
the return String, and the only challenge there is eliminating duplicates. One way
to do this would be to keep track of the last character, and only append the next
character if it differed. An easier way is to just add all the characters, and
then use a regular expression to remove the duplicates. This is done in the
replaceAll() method of the return statement.

If you're not familiar with the assignment on line 10, all this does is assign the
result of isVowel() to both prevIsVowel and cvArray[i] in one line. First, isVowel()
is evaluated and the result is assigned to prevIsVowel. The result of this assignment,
which is either true or false, is then assigned to cvArray[i]. With that, we've
put the correct character (either a 'V' or a 'C') into the array, and set prevIsVowel
to the correct value for the next call into isVowel().

Thank you for taking the time to read this solution. I welcome
any feedback you may have.

This problem becomes very easy once you break it down into smaller steps. The first task
is to take the unwieldly String[] and convert it into an easy to use 3 dimensional array
of chars. This is handled on lines 15-23. Nothing trick here, except for a little bit
of math to get the right character out of the String.

With our 3-D array, we can now loop through each position and count the number of lines
starting at that position. Note that we'll count each row twice. Once starting from
each end and going to the other.

The countLinesStartingAt() method does just that. Given a 3-D coordinate, it returns
the number of lines starting from that position. Rather than writing out the 27 directions
that we could move out from for any given position, I have three nested loops and the
variables deltaX, deltaY, and deltaZ. Each of these variables moves from -1 to 1.

With that, we call isLine() providing the staring point, direction, and color. isLine()
just checks that we stay within the confines of the cube and stay on the correct color
as we move along the line.

Nothing really difficult here. It could probably have been a Division 2 Level 2.

Thank you for taking the time to read this solution. I welcome
any feedback you may have.

The first step is to determine how many seconds the skewed clock is away from the true time. This
is calculated on lines 18-27 and is stored in skewSeconds. Note that if skewSeconds is positive
then the skewed clock is behind true time. If skewSeconds is negative, then the skewed clock is
ahead of the true time.

If skewSeconds is 0, then we can simply return 0. Otherwise, we'll want to divide the number of seconds
the two clocks are off by the hourlyGain. This is fine if the skewed clock is ahead and hourlyGain is
negative; or if the skewed clock is behin and hourlyGain is positive. But we must account for two other
cases as well.

If the skewed clock is ahead, and the hourlyGain is positive, then it's distance ahead will keep increasing.
To fix this, we can just set the skewed clock back 12 hours. Similary, if the skewed clock is behind, and
the hourlyGain is negative, we can adjust the skewed clock ahead 12 hours. Be careful with the signs here,
it can get a little confusing.

Thank you for taking the time to read this solution. I welcome
any feedback you may have.

The solution starts by creating an array (heights) to store the two closest numbers. It sets
their initial values to Integer.MAX_VALUE to ensure they're far enough away from our height
that the first two numbers seen are guaranteed to be closers.

Then we make one pass through the list of candidate heights. If the height is closer than
the value in position 0, we move the closest into the second closest position, and insert
our candidate in position 0 as the next closest height.

If the height is not the closest, but it is closer than the second closest, then we simply
replace the the height in position 1 with our current candidate's height.

The method isCloser determines if the value is candidate is closer to height than the value of
current. Note that we must take the absolute value of the difference. In the event of a tie
closer is determined by if candidate is greater than current.

Thank you for taking the time to read this solution. I welcome
any feedback you may have.

A pretty easy problem for a Division 2 - Level 3. There's just two tricky things to take care of. First, we
need to divide the input into columns that are no wider than the given width. To do this, I create a single
list that contained all of the words. Note that the lines may have trailing and/or leading whitespace which
we want to remove. Combining trim() with .split("\\s+") gives us the individual words nicely.

Next, I divide the words by line into one column, such that the length of each line is less than or equal
to width. This is done easily enough by the loop on lines 28 - 62. We just test the length of the current
line plus a space plus the length of the next word. If that is greater than width, cut the line off and
put the word at the beginning of the next line.

Finally, we need to split the one column up into two columns with the lines interleaved. The easiest way
to do this is to assign all the even numbered positions first. Then upon reaching the end of the list,
come back to position 1, and start filling in the odd positions.

Thank you for taking the time to read this solution. I welcome
any feedback you may have.

I've created a class Team the implements Comparable so that we can use Java's built-in sort capabilities.
All the logic necessary for sorting the teams is contained in the Team.compareTo() method.

With that, it's just a matter of creating the team objects, and adding their finishing places. Lines 67-70
create an array of teams and assign each one it's name. Then the loop on lines 79-82 works through each of
the letters in finishOrder and calls addFinisher() on the corresponding team. We can get the correct team
by subtracting 'A' from the current letter. For example, if the letter is 'C', the 'C' - 'A' = 2, which
is the position in the teams array of team C.

The addFinisher() method handles the logic of determining if this runner's score counts toward the team's
score (it's a top 5 runner), or if we should store this score in tieBreaker (if it's the 6th runner for
that team).

Once all the team data is populated, we add only those teams with 5 or more runners to the qualifyingTeams
list, sort the list, and then add each team's name in order to the string that we return.

Thank you for taking the time to read this solution. I welcome
any feedback you may have.

The first task is to parse each string in the array to get the size of the die and
the number of rolls. This is easy enough using String.split(). By splitting on
the "d" character, we'll get the number of rolls in position 0, and the size
of the die in position 1 or the resulting array.

To get the minimum value, we just assume that the die always comes up one. So, minimum
is just equal to the number of die rolls.

To get the maximum value, we assume that die always comes up with it's largest possible value.
Here, we just multiple the number of rolls by the size of the die.

Then, we compute the average using the formula on line 22.

We these three values calculate, we just create an int[] to hold them, and return it.

Thank you for taking the time to read this solution. I welcome
any feedback you may have.