So, basically, in the question, Build BST from a sorted array of n intergers, I forgot to read that the array is sorted. Hence I sorted the array using the sort function and then solved the question. Only 1 Testcase passed
However, later I noticed that the array is already sorted in input, hence no need to sort it again. So I uncommented that line and guess what? All testcases passed
It would be great if anyone explained this miracle to me !
The code is over here : https://ide.codingblocks.com/s/312699
Refer to the uncommented line on Line No 55
Also, the same question using redundant sorting, on GFG passed all the test cases. So is there something wrong with this question’s test case?