Made a little progress on the hard part of DP187Easy