Код: Выделить всё
// The API isBadVersion is defined for you.
// bool isBadVersion(int version);
class Solution {
public:
int firstBadVersion(int n) {
int min = 0, max = n;
int mid;
while (min
Подробнее здесь: [url]https://stackoverflow.com/questions/79403498/how-do-i-binary-search-for-the-first-true-value-leetcode-278-first-bad-version[/url]
Мобильная версия