Leetcode 650. 只有两个键的键盘 class Solution { public: int minSteps(int n) { int cnt = 0; for (int i = 2; i * i <= n; i ++ ) while (n % i == 0) { n /= i; cnt += i; } if (n > 1) cnt += n; return cnt; } };