Minimum Keypad Click Count

Asked at Amazon · Coding Questions · Difficulty: Medium

A keypad has 9 buttons; each holds up to 3 lowercase letters, and every letter is on exactly one button. Typing a letter on the k-th position of its button costs k clicks. Choosing the best layout, return the minimum total clicks to type the string `letters`.

Loading the problem…