Find the kth smallest

This code fails one test case. Can’t figure out the problem.

hi @Rheaaa y r u doing i+=2 ? numbres can be of 2 digit or 3 digit also right?? handle that case

1 Like


Corrected the above issue but now this gives TLE how can this be optimised?

hi @Rheaaa try to use strtok function to extract digits
https://www.tutorialspoint.com/c_standard_library/c_function_strtok.htm refer this, this will make your code clean and also reduce no of lines of codes

1 Like

hey @talhashamim001 Can’t figure out how to create tree using strtok


This code still gives TLE in one test case even after using strtok. Can you please correct the code.

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.