test markdown style

code

// Forward declaration of isBadVersion API.
bool isBadVersion(int version);

class Solution {
public:
    int firstBadVersion(int n) {
        int l = 1;
        int r = n;
        int m;
        while (l <= r) {
            m = l + (r - l) / 2;
            if (isBadVersion(m)) r = m - 1;
            else l = m + 1;
        }
        return l;
    }
};
posted @ 2018-11-01 18:47  Veritas_des_Liberty  阅读(147)  评论(0编辑  收藏  举报