The code works fine for sample test cases and some more inputs on ide but fail at submission.
On reversing line 4 condn the code pass 1 test case only for next smaller problem in recursion
Test case failing
@piyush.bansal8158625
hello piyush,
store all valid strings in vector and then sort them lexicographically and then print
Its not working…not printing anything,written comp in sort also still same.
But whats wrong with the first approach
@piyush.bansal8158625
you were not getting output because u passed vector v by value but actually u shoud pass it as reference.
I have made some change in ur code pls check.
ur code is also correct just pass vector v by reference
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.
i have already rated you. Please solve my 2 doubts in tree section.
- bottom view of tree 1 test case failing.
- k nodes from given node. 2 test case failing
@piyush.bansal8158625
see for bottom view ,ur logic need bit modifications. in ur map strore height and level for each key.
update ur map in only two cases
a) case 1 -> when key is encountered first time
b) case 2-> when new level value is more than then stored level value for a given key
pls check ur thread , i have shared one example where ur code is failing
for k nodes , i think someone else is taking it. and i cannot intervene .