HTML/CSS/JavaScript 解法, 执行用时: 1682ms, 内存消耗: 77804KB, 提交时间: 2022-02-09
{"css":"","js":"function _max(array) {\n // 补全代码\n array.sort(function(a,b){\n return b-a\n })\n return array[0]\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1739ms, 内存消耗: 77872KB, 提交时间: 2022-01-21
{"css":"","js":"function _max(array) {\n // 补全代码\n return array.reduce((acc, cur)=>{\n if( acc < cur){\n acc = cur;\n }\n return acc;\n }, -Infinity)\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1741ms, 内存消耗: 77776KB, 提交时间: 2021-12-15
{"css":"","js":"function _max(array) {\n // 补全代码\n const res = Math.max(...array)\n \nreturn res\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1741ms, 内存消耗: 77868KB, 提交时间: 2021-12-12
{"css":"","js":"function _max(array) {\n // 补全代码\n return Math.max(...array);\n return Math.max.apply(null,array)\n return array.sort((a,b)=>b-a) [0]\n return array.sort() [array.length-1]\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1742ms, 内存消耗: 77820KB, 提交时间: 2021-12-04
{"css":"","js":"function _max(array) {\n // 补全代码\n let max = -9999\n array.forEach(value => {\n if(value > max) max = value\n })\n return max\n}","html":"","libs":[]}