leetcode 常用java函数

一:算对数log2(7) value为7, base为2

class Logarithm {
    static public double log(double value, double base) {
        return Math.log(value) / Math.log(base);
    }
}

 二:字符串转整数

Integer.parseInt(ss1[i++]);

 

posted @ 2022-01-04 18:35  ou尼酱~~~  阅读(162)  评论(0)    收藏  举报