未验证 提交 b2aa716a 编写于 作者: 梦境迷离's avatar 梦境迷离 提交者: GitHub

Merge pull request #35 from KongWiki/wkk

add branch wkk
package io.github.wkk;
/**
* @Time: 2020/7/30上午9:18
* @Author: kongwiki
* @Email: kongwiki@163.com
*/
public class TwoSum {
}
package io.github.wkk.everyday.junly;
/**
* @Time: 2020/7/30上午8:52
* @Author: kongwiki
* @Email: kongwiki@163.com
*/
public class IntegerBreak_343 {
public int integerBreak(int n) {
int division = 3;
if(n <=division){
if(n <= 2){
return 1;
}else {
return 2;
}
}
if(n%division == 0){
return (int)Math.pow(division, n/division);
}else if(n%division == 1){
return (int)Math.pow(division, n/division - 1) * 4;
}else {
return (int)Math.pow(division, n/division) * 2;
}
}
}
## 每日一题
1. [343. 整数拆分](./everyday/junly/IntegerBreak_343.java)
## 哈希表
1. [1. 两数之和](./TwoSum.java)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册