removeShorterStrings

Category: ArrayList
Author: Stuart Reges
Book Chapter: 10.1
Problem: removeShorterStrings
  Write a static method removeShorterStrings that takes
   an ArrayList of Strings as a parameter and that removes from each successive
   pair of values the shorter String in the pair.  For example, suppose that an
   ArrayList called "list" contains the following values:

        ("four", "score", "and", "seven", "years", "ago")

   In the first pair of Strings ("four" and "score") the shorter String is
   "four".  In the second pair of Strings ("and" and "seven") the shorter
   String is "and".  In the third pair of Strings ("years" and "ago") the
   shorter string is "ago".  Therefore, the call:

        removeShorterStrings(list);

   should remove these shorter Strings, leaving the list with the following
   sequence of values after the method finishes executing:

        ("score", "seven", "years")

   If there is a tie (both Strings have the same length), your method should
   remove the first String in the pair.  If there is an odd number of Strings
   in the list, the final value should be kept in the list.  For example, if
   the list contains the following values:

        ("to", "be", "or", "not", "to", "be", "hamlet")

   After calling removeShorterStrings, it should contain the following:

        ("be", "not", "be", "hamlet")

   You may assume that the ArrayList you are passed contains only Strings.

   Recall that the primary methods for manipulating an ArrayList are:

        add(Object value)		appends value at end of list
	add(int index, Object value)	inserts given value at given index,
					shifting subsequent values right
        clear()                         removes all elements of the list
	get(int index)			returns the value at given index
	remove(int index)		removes value at given index, shifting
					subsequent values left
	set(int index, Object value)	replaces value at given index with
					given value
	size()				returns the number of elements in list

   Write your solution to removeShorterStrings below.