Search
⌘K
Get Premium
Leetcode 650. 2 Keys Keyboard
Starting from one 'A', find the minimum number of Copy All and Paste operations to reach exactly n 'A's. The core challenge is number-theoretic: the optimal sequence corresponds to factorizing n, so the minimal operations equal the sum of n's prime factors (with multiplicity).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.