Non overlapping Longest Increasing Subsequence (L1) And Decreasing Subsequence (L2)in array with max length (L1+L2)

Revision en1, by Sangar, 2017-04-11 20:31:42

Hello,

I have been trying this question on Spoj BatMan2

It requires to find a LIS from left to right and a LIS from right to left but non overlapping

Someone suggested this solution in comments

really aww sum problem cant wait to share the idea simply go one way and give each number to a increasing or decreasing or nothing max among three is ans

can anyone help with this DP problem

Tags dp, maths

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Sangar 2017-04-11 20:31:42 562 Initial revision (published)