I'll start of with an example, to clarify what kind of algorithm I'm looking for:
For example, there are the words one
, two
and three
. Those could be arranged like that:
three
w
one
or
t
h
t r
w e
one
More examples:
t
eight
t r
w e
one
eightwo
h
r
one
e
n
eightwo
n h
e r
one
e
eightwo
h
r
one
nine
etc.
How could I achieve this algorithm, for getting the
a) the least character count?
b) tightest arrangement?
c) for any combination?
This is not homework nor a interview question, I'm trying to rebuild the QlockTwo with a slightly different design.