Binary search Python 2.7

I’m getting WA on SPOJ.
Here’s the problem: http://www.spoj.com/problems/BSEARCH1/
Here’s the code: http://ideone.com/0CSrEj
(it includes optimization)

I need a test case that will help to find a mistake. I’ve tried several cases and can’t find mistakes.

See input number 2 on your link it is giving RE (list index out of range) check it out.

1 Like