Skip to content

Commit 46d677a

Browse files
authored
Create 1689-partitioning-into-minimum-number-of-deci-binary-numbers.js
1 parent a77bd21 commit 46d677a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* @param {string} n
3+
* @return {number}
4+
*/
5+
var minPartitions = function(n) {
6+
let res = 0
7+
const arr = n.split('').map(e => parseInt(e))
8+
for(let i = 0, len = arr.length; i < len; i++) {
9+
res = Math.max(arr[i], res)
10+
}
11+
return res
12+
};

0 commit comments

Comments
 (0)