Your Internet startup needs a domain name. Your market research guru tells you that users tend to avoid sites with names that are hard to type. Thus, you must pick a name that is easy to type. For your research, you decide to use the idealized keyboard model suggested by Figure 1 . Note that the keys are perfectly aligned both horizontally and vertically, unlike the skewed positioning of keys in typical keyboards.
Consecutive characters are easier to type if they use different hands.
Therefore, we say that each pair of consecutive characters that uses the same typing hand contributes 1 unit to the typing cost. For example, typing d followed by a adds 1 to the this component of the typing cost because d and a are both typed using the left hand. On the other hand, typing n followed by e does not contribute anything to this component of the typing cost because n and e are typed using different hands. In order to type characters that are not in this middle row of keys, the hands are moved to the top and bottom rows. For example, to type r , the left hand is moved to the top row.