Test Case given in README.txt of Binary Search is wrong
Closed this issue · 2 comments
quantumcoder121 commented
The test case which has the input as 4 3 and output as 2 is wrong because the correct output should be -1. It's not possible to make 4 out of 2 and 3.
SubarnoNR commented
It is indeed possible. First split the first pipe into 3 using the splitter of size 3. Choose any 1 resulting pipe and split it into 2 using splitter of size 2. You have 4 output pipes now as required. Here is a poor representation of this case :
.....|
../ |
/ | | \
quantumcoder121 commented
Oh you're right. Sure then it's resolved. Closing the issue.