From: Ian Hobson Date: 2008-05-04T22:26:22+09:00 Subject: Re: Array combination check Nadim Kobeissi wrote: > Xavier Noria wrote: > >> What is a combination? >> > > Please allow me to make myself more clear: > bunny=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"] > cow="hello" > > I want to test all possible combinations of the items inside bunny (the > alphabet) starting from the smallest to the biggest (a, then b, then c.. > then aa, then ab, then ac, etc.) until I arrive to a case in which the > combination == cow, which means the combination would be "hello". > I gather that the letter l matchs twice! You only discover that every letter in cow is in bunny. This yu can go for directly, with a quick algorithm. Foreach letter in cow if letter not in bunny fails match success! Ian