Create distinct subsequence

recursive version