can anyone help me with a problem I'm kinda new to C++. Here is my question:
Write a function of the form string mirrorEnds(string), that when given a string, looks for a mirror image (backwards) string at both the beginning and end of the given string. In other words, zero or more characters at the very beginning of the given string, and at the very end of the string in reverse order (possibly overlapping). For example, the string "abXYZba" has the mirror end "ab".
mirrorEnds("abXYZba") → "ab"
mirrorEnds("abca") → "a"
mirrorEnds("navan") → "navan"
I think I can do it if I can convert the string into an array of chars can this be done?