Link: https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/
Solution:
Intuition
Quite a simple problem…not much to it. Basically, the key insight is that the words should be prioritized by frequency. So more frequent words deserve higher placement in the mapping. The implementation is somewhat trivial. We can also use heap but there is no point.
Implementation