You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * Definition for isBadVersion() * * @param {integer} version number * @return {boolean} whether the version is bad * isBadVersion = function(version) { * ... * }; *//** * @param {function} isBadVersion() * @return {function} */varsolution=function(isBadVersion){/** * @param {integer} n Total versions * @return {integer} The first bad version */returnfunction(n){letleft=0;letright=n;while(left<right){letmiddle=Math.floor((left+right)/2);constisBad=isBadVersion(middle);if(isBad){right=middle;}else{left=middle+1;}}returnleft;};};
The text was updated successfully, but these errors were encountered:
278. 第一个错误的版本
The text was updated successfully, but these errors were encountered: