InterviewBit Problems   Pick from both sides! : Unsolved

About the Pick from both sides! : Unsolved category (1)
I have seen the solution, but im not sure of the difference, it still gives random answers (4)
This Solution works for most of the cases except this one. What is wrong with this Solution? (1)
Wrong Output of testCase (2)
What is wrong in this code? Not able to find it (1)
Editorial solution is absolutely wrong (4)
Stupid problem statement (2)
Why is this solution giving wrong answer? (1)