旋转数组的最小数字

    技术2025-10-19  10

    function minNumberInRotateArray(rotateArray) { // write code here if(rotateArray.length==0){ return 0; } var minVal=rotateArray[0]; for(var i=1;i<rotateArray.length;i++){ if(rotateArray[i]<minVal){ minVal=rotateArray[i]; } } return minVal; }

     

    function minNumberInRotateArray(rotateArray) { // write code here if(rotateArray.length==0){ return 0; } return Math.min(...rotateArray); }

     

     

    Processed: 0.010, SQL: 9