Tony's Log

Algorithms, Distributed System, Machine Learning

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Check out this brilliant solution:
https://discuss.leetcode.com/topic/70658/concise-java-solution-using-dp

My first solution was a O(n^2) typical DP boiler-plate code. The key is, that solution is too generalized. With given char as the ending char in such a string, its previous chars are the same.

posted on 2017-01-28 15:24  Tonix  阅读(99)  评论(0编辑  收藏  举报