Update WordBreak.java

adding a O(n^2) solution using dynamic programming