Leetcode: 650. 2 Keys Keyboard
2017-11-14 20:53
309 查看
c++:
class Solution { public: int minSteps(int n) { if (n == 1) return 0; for (int i = 2; i < n; i++) if (n % i == 0) return i + minSteps(n / i); return n; } };
相关文章推荐
- LeetCode650. 2 Keys Keyboard
- leetcode 650. 2 Keys Keyboard
- LeetCode 650. 2 Keys Keyboard
- Leetcode 650. 2 Keys Keyboard[medium]
- leetcode_650. 2 Keys Keyboard
- LeetCode650. 2 Keys Keyboard
- leetcode 650. 2 Keys Keyboard
- LeetCode | 650. 2 Keys Keyboard 数学原理题分析
- Leetcode 650. 2 Keys Keyboard
- leetcode 650. 2 Keys Keyboard 最小复制粘贴次数 + 深度优先遍历DFS
- [LeetCode] 650. 2 Keys Keyboard 两键的键盘
- LeetCode 650. 2 Keys Keyboard--动态规划
- 【精】leetcode - 650. 2 Keys Keyboard 【动态规划 + 质数 & 非质数 + 简洁表达】
- [LeetCode] 650. 2 Keys Keyboard
- [Leetcode] 650. 2 Keys Keyboard 解题报告
- LeetCode -- 650. 2 Keys Keyboard
- Leetcode 650. 2 Keys Keyboard 2指键盘 解题报告
- [LeetCode] 650. 2 Keys Keyboard
- [LeetCode] 650. 2 Keys Keyboard
- Leetcode 650. 2 Keys Keyboard