Recursion-Dictionary Question

My code:-

For Dictionary order(larger) question, my code is working fine for smaller string but giving TLE for larger string. On submitting two of the testcases shows TLE error.

hello @balpreet_kaurqEB

check now->

okay I got the answer by making the function void but if I don’t pass the vector by reference and the function return type is vector, why is it showing TLE error?

…

passing by value is time taking becuase in that one object copied to other which is time taking.
read the difference between pass by value and pass by reference u will get the answer.

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.