Ad
  • Custom User Avatar

    For each letter in the alphabet (26 letters) you are searching in the string with O(n+m), where m is the substring, therefore m => 1. So you are doing 26 * (n + 1), which is not that efficient.