NeetCode #790LC-3016MediumGreedy
← Back to All Problems#790 · #3016 · Minimum Number of Pushes to Type Word II(输入单词需要的最少按键次数 II)
📌 Problem Statement & Constraints
You are given a string
word. You may remap letters to the eight keys labelled 2 to 9; the cost to type a letter is its position on its key (1-indexed). Return the minimum total pushes to type word. Constraints: 1 <= word.length <= 10^5, word consists of lowercase English letters.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!