Smarter solution vs almost pure luck.

Just apply ideas from patience sorting for find
the longuest increasing subsequence.