标签: math
-
leetcode453-Minimum-Moves-to-Equal-Array-Elements
从一个长度为n非空整数数组中,找到能够使得数组中每个元素的值都相等的最少步数,一步是指选择对数组中的n-1个元…
-
leetcode413. Arithmetic Slices
将包含大于等于三个元素且任意相邻两个元素之间的差相等的数组成为等差数列。现在输入一个随机数组,问该数组中一共可…
-
leetcode423. Reconstruct Original Digits from English
一个非空的英文字符串,其中包含着乱序的阿拉伯数字的英文单词。如012对应的英文表达为zeroonetwo并继续…
-
JavaScript 精粹:Number 与 Math
这是 JavaScript 精粹的系列篇,涵盖了 JavaScript 中最常用和最重要的方法,以及其它一些基…
-
leetcode390.Elimination Game
假设有1-n一共n个数字,从左往右开始每隔一位删除一个数字,到达最右侧后,再从右往左每隔一位删除一个数字,如此…
-
[LeetCode] 223. Rectangle Area
Find the total area covered by two rectilinear rectangl…
-
[LeetCode] 402. Remove K Digits
Given a non-negative integer num represented as a strin…
-
[LeetCode] 258. Add Digits
Given a non-negative integer num, repeatedly add all it…
-
较常用的Math方法及ES6中的扩展
记录下与Math有关的常用方法,如:求最大值、最小值等,或者是保留几位数啥的 1.数据 {代码…} 2.求…
-
leetcode397. Integer Replacement
可以发现除二后所得到的结果一定优于加减1。因此,如果当前奇数除二为偶数,则直接做除法,否则将当前奇数加一再除以…