Adding 'subsequence' method into algorithms