Generate all possibilities eliminating duplicates for early levels, then proceed using normal algorithm