Ok, here is the correct idea after 2 weeks with the problem. and it is
simple...

consider only 6 letters a to f. So codes are:
a=1
b=2
.
f=6
ab=7
ac=8
.
af=11
bc=12
.
bf=15
cd=16
.
cf=18
de=19
df=20
ef=21
abc=22
.
.

now we construct a 6*6 matrix like this:

     1    2    3    4    5    6 (no. of letters in word)
a   1    5   10   .............  (no. of letters following or no. of
letters that can be in order.)
b   1    4    6    ............
c   1    3    3    ............
d   1    2    1    ............
e   1    1    0    ............
f    1    0    0    ............

^
|
(no. of occurences)

Now to get a number of a word, add the digits bellow that, upto that
number of letters.

Like,
a=1
b=1+1=2
.
f=1+1+1+1+1+1=6
ab=1+1+5=7  (code of b + code of a as in 2nd letter)
ac=1+1+1+5=8
abc=1+1+1+5+4+10=22 (code of c + code of b as in 2nd letter + code of a
as in 3rd letter)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups-beta.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to