Detect impossible binary search comparison sequence | Bitkernel Interview Question