Count binary search steps for specific keys | Bitkernel Interview Question