looking for a better solution to a dp problem

Правка en1, от OverKiller, 2020-11-07 10:52:04

This problem appeared in a Hiring Challenge on Hackerrank and i couldn't solve it in better than $$$O(N^2)$$$ which was giving TLE. Here is the problem below:

Spoiler

I can't think of a solution better than $$$O(N^2)$$$. Any help/hints will be appreciated.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский OverKiller 2020-11-07 10:52:04 615 Initial revision (published)