How can i solve this using strtok?

How can i solve this using strtok?

@garganshul151, solving this question using strtok() is not recommended , let me tell you why , using strtok() what you do is u split the string into several parts based on the delimiter eg:-

if str=“Abhijeet_kumar_jha”
and delimiter passed is “_”
then we will have three strings [“Abhijeet”,“kumar”,“jha”] also note that delimiter is not attached with any of the string.
but in this question we have to split the string based on the occurrence of capital alphabets, which introduces two main problem in this approach :-

  1. the delimiter is variable, as there are 26 capital alphabets so would’nt be able to specify a unique delimiter , or we would have to split the string several time for each capital alphabet
  2. we have to include the capital alphabet in the word , as in strtok we don’t include the delimiter

so , i would suggest you to think of some different algorithm ,as implementing this would be tough and pointless as we can do this question with much ease without using any fancy algo

if you want hint for solving this question , do tell me…
In case of any doubt feel free to ask :+1:
Mark your doubt as RESOLVED if you got the answer

Thank you for such an answer.

welcome !! please mark your doubt as RESOLVED if no further issue