Assume we have two char stream like:

```
S = 1,2,3,5,7,4,4,10,11,12
T = 3,1,2,9,6,4,10,5,9

```

I want to find biggest sub-sequence of this streams such that they will be same by some sort of rearrangement, for example in this case `1,2,3` in first and 3,1,2 in second stream, can be converted to each other by rearrangement, and seems it's largest (with length 3).

Algorithm for O(n^2) is available in [Quadratic time algorithms for finding common intervals in two and more sequences](http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.88.8217).

Any idea well come, There is no need to improve it or if you have an idea prove your idea. I want to use is to get result in my problem, time complexity is not good for my current dataset.