HTML/CSS/JavaScript 解法, 执行用时: 1679ms, 内存消耗: 77800KB, 提交时间: 2022-02-09
{"css":"","js":"function _sort(array) {\n // 补全代码\n //冒泡排序\n //外层循环走趟数=length-1 内层循环走次数length-i-1\n for(var i=0;i<=array.length-1;i++){\n for(var j=0;j<array.length-i-1;j++){\n if(array[j]<array[j+1]){\n var temp=array[j];\n array[j]=array[j+1];\n array[j+1]=temp;\n \n }\n }\n }\n return array\n \n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1684ms, 内存消耗: 77772KB, 提交时间: 2022-02-08
{"css":"","js":"function _sort(array) {\n // 补全代码\n return array.sort((a,b)=>{\n return b - a\n })\n \n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1684ms, 内存消耗: 77816KB, 提交时间: 2022-02-08
{"css":"","js":"function _sort(array) {\n // 补全代码\n array.sort((a,b) => b-a);\n return array\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1686ms, 内存消耗: 77800KB, 提交时间: 2022-02-09
{"css":"","js":"function _sort(array) {\n // 补全代码\n return array.sort((a,b)=> {\n return b-a;\n })\n}","html":"","libs":[]}
HTML/CSS/JavaScript 解法, 执行用时: 1686ms, 内存消耗: 77800KB, 提交时间: 2022-02-08
{"css":"","js":"function _sort(array) {\n return array.sort((a,b) => b-a)\n}","html":"","libs":[]}