Ques:-Floor in BST
ide:-https://ide.geeksforgeeks.org/pb4CqBzn2r
Test case:-
7 4
3
Failing in one test case
My code is not passinng that tst case so i want to know wht is the problem in my code and what changes it require.
@manikjindal49 i think the problem is in the base case if the root is null then may be you dont have to return -1 .
please see this in question wherever you are trying to submit it .
there can be extra condition for it .
Can you please tell me why the base condition is wrong
and even after removing that base condition it is showing error for same test case
no i am saying that you should return according to the output format in th base case .
I am not understanding what you are saying could you please help me and correct my code with comments so that i can understand that also
I am not understanding what you are saying could you please help me and correct my code with comments so that i can understand that also
yes sure but could you please share the qustion link where you are trying to submit it .
so that i can see the output format.
you are for sure missing any test case .
Actually even if share the link then you would not be able to do that question so thats why not able t share it
then how can i see the questions exact language ?
.you ca try to submit the same question on any other platform .you should be clear of how to solve or code for particular question you should not worry this much about particular question on particular platform.
if you still have doubt please ask here .
Happy Learning !!
The question is this only no changes are there in that we just have to find floor of a number in bst
you are trying it on gfg right ?
i have also checked there and yes the wording is same .
have you seen their way of implementation ?
Yes but is there any difference bcz the main thing is i want to know the error in my code so that i am able to understand my mistake
every platform can have different edge cases or output formate but there is question is incomplete then the only option you are left with is of seeing their way of implementation and what they are doing .
Happy Learning !!
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.