10. first bad version

Is this helpful ?

from all members: - accepted / - tried

Say you have 500 multiple versions of a program, write a program that will find and return the first bad revision given a isBad(version) function.

Versions after first bad version are supposed to be all bad versions.


  1. Inputs are all non-negative integers
  2. if none found, return -1

Let's try to solve this problem within 10 mintues.