S0cI0pAtH's blog

By S0cI0pAtH, history, 8 years ago, In English

How i can solve it if n = 5000 in the following problem ? http://postimg.org/image/4cfbw9vc5/ thanks in advance :)

  • Vote: I like it
  • -3
  • Vote: I do not like it

»
8 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

The naive O(N3) approach can be optimized to O(N2).
Read about palindrome partitioning