function numberofprize( a,b,c ) { // write code here let arr = [a,b,c] arr.sort((a,b) => a-b) if(arr[2] > arr[1]){ if(arr[2] - 2 <= arr[0] ){ return arr[0] } } if(arr[2] == arr[1]){ if(arr[2] - 1 <= arr[0]){ return arr[0] } } if(arr[2] == arr[1] && arr[1] == arr[0]){ return arr[0] } else if(arr[2] === arr[1]){ arr[2] = arr[2] - 1 arr[1] = arr[1] - 1 arr[0] = arr[0] + 1 } else{ if(arr[2] - 2 > arr[0]){ arr[2] = arr[2] - 2 arr[0] = arr[0] + 1 } } return numberofprize(arr[0],arr[1],arr[2]) } 这样为什么就0了,也没有显示超时,测试了几个也对