This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Just as there are many roads that lead to Rome, there are many solutions to any program. In the end, if your solution works (and is tested successfully with multiple inputs, both with and without matches) then it is a correct solution.