Leetcode 650 Solution
This article provides solution to leetcode question 650 (2-keys-keyboard)
Access this page by simply typing in "lcs 650" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
https://leetcode.com/problems/2-keys-keyboard
Solution
class Solution:
def minSteps(self, n: int) -> int:
ans = 0
m = 2
while n > 1:
while n % m == 0:
ans += m
n //= m
m += 1
return ans