3275. Minimum Number of Pushes to Type Word I
My accepted Python solution to LeetCode problem 3275, Minimum Number of Pushes to Type Word I, running in 0ms.
- Difficulty: Easy
- Python
- Runtime 0ms
- Memory 17.1MB
- Updated
Read the problem on LeetCode View on GitHub
The problem statement is LeetCode’s and stays on their site. What follows is my accepted solution.
Python
Accepted on LeetCode — runtime 0ms, memory 17.1MB, accepted 2026-01-01.
class Solution:
def minimumPushes(self, word: str) -> int:
n = len(word)
pushes = 0
keys_used = 0
press_count = 1
for i in range(n):
pushes += press_count
keys_used += 1
if keys_used == 8:
keys_used = 0
press_count += 1
return pushes