Hi,
I appreciate the responses and making my question more clear, as needed from the assumption in the responses made.
All the data I have provided is correct, requires a bit clarification though.
Ordered Array: (1,2,3,8,4,5,6)
I know that 8 is there in the middle and it is correct. It is just a sample of some items which are represented by let's say symbols (here integer numbers) and the provided is let's say the current order of items arrangements.
Given Array: (2,1,4,3,5)
Looking at the common maximum length 'ordered subsets' of both the array.
(2,3,5)
(1,3,5)
(2,4,5)
(1,4,5)
Thus maximum length subset I can find here is '3' and above 4 are such subsets.
I am looking for answer such as length '3' and above found subsets. '3' is part of the
answer here and not the
input.
Other Subsets could be:
(1,2,3,8,5)
(1,2,8,4,6)
etc.. But it's not part of the given array.
Other sets such as
(1,4)
(8,6)
(2,3)
Are there and is also part of the given array but small in length (2) compared to what we found earlier.
It's really not an attempt to find the max length of increasing integers slice as answered. (Thanks for the attention)
I hope it makes sense now.
Thanks,
Artist
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.