LeetCode Minimum Factorization
来源:互联网 发布:兼职美工如何收费 编辑:程序博客网 时间:2024/06/05 18:05
public class Solution { int[] aa = new int[100];int j = 0;boolean flag = true; public int smallestFactorization(int a) {smallest(a);Arrays.sort(aa);String string = "";if(j > 31 || !flag) return 0;for(int i = 0; i < 100; i++) {if(aa[i] != 0) {string = string + aa[i];}}if(string != "") { Long temp = Long.parseLong(string); if(temp > Integer.MAX_VALUE) { return 0; } else { return Integer.parseInt(string); }} else return 0; } public void smallest(int a) {if(a <= 9) {aa[j++] = a;return ; }for(int i = 9; i >=2 ; i--) { if(a % i == 0) { aa[j++] = i; smallest(a/i); return; } } flag = false;return ; }}
62
gld阅读全文
0 0
- leetcode-625. Minimum Factorization
- LeetCode Minimum Factorization
- leetcode 625. Minimum Factorization
- leetcode 625. Minimum Factorization
- Minimum Factorization
- 625. Minimum Factorization
- 625Minimum Factorization
- 625. Minimum Factorization & 621. Task Scheduler
- Factorization
- LeetCode: Minimum Path Sum
- LeetCode: Minimum Window Substring
- LeetCode Minimum Path Sum
- LeetCode Minimum Window Substring
- LeetCode : Minimum Path Sum
- LeetCode : Minimum Window Substring
- [Leetcode] Minimum Path Sum
- [LeetCode] Minimum Path Sum
- [LeetCode] Minimum Window Substring
- 面向思想的落地法则一
- 复习三-bfs
- Arduino 使用Metor库 简单实现多线程编程
- 3.vector实现字符串类
- 【reset.css重置文件夹】
- LeetCode Minimum Factorization
- Java多线程之interrupt()的深度研究
- 杨辉三角
- 从0开始学git 第3节:给git设置用户名和email address
- Android高仿QQ小红点
- try catch finally的执行顺序
- python安装机器学习(百度)
- 一步一步理解线段树
- java炒冷饭系列06 异常匹配