I am trying to find a similar function to strstr that searches a substring starting from the end towards the beginning of the string.
strstr
Here is one. Testing it is an exercise I'll leave to you :)