Time complexity of solution

Can you please explain the time complexity of problems

Hey shahzeer123!, here for a particular string in given array of strings, we check for

  1. presence of every prefix in reversed order //O(1)
  2. check whether remaining string is palindrome or not //O(k),k is string length
    we do this k times for every element(string). So Complexity for one element is kk1, and we do this for n elements so overall complexity is nkk.

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.