wncc/helloFOSS-21-ContributiveProgramming

Test Case given in README.txt of Binary Search is wrong

Closed this issue · 2 comments

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.

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 :
.....|
../ |
/ | | \

Oh you're right. Sure then it's resolved. Closing the issue.