If we pass a vector of char instead of passing the char array by reference because the vector is passed by value so there is no problem of permanent change in string and then maybe there is no use of backtracking
Can we paas vector of string instead char array
hello @manmeetkahlon
no then we will need to backtack.
becasuse in a function we are working on same string (different function will contain different copy)
so if u will do swap(s[i],s[j])
then again u need to perform swap(s[i],s[j]) afteer ffunction call. to regain the original string
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.