← ALL NOTES
Math

3014. Minimum Number of Pushes to Type Word I

Every letter in the word is distinct, so the frequency counts that make problem II fiddly never enter the picture here — this collapses to counting. You have eight keys, each key's first press is the cheapest, its second press costs two, and so on; place letters shallowest-first and the i-th letter you assign costs i/8 + 1 pushes.

Loading…