Unique word pair hint


cant identify mistake
getting wrong answer

Hey Dakshi, I see your implementation is little bit incorrect! Please take care of these:

  1. Don’t make entry of substrings into hashmap (make only for given strings).
  2. give a check whether current string can be a prefix! for that consider every prefix and see whether reverse of it is present and remaining string is palindrome.
    for this j should go from 0 to length (not <length, as an edge case involves empty string as well)
  3. Do similar for suffix check!
    There can be duplicate pairs as well in final answer so take care of them as well(eg answer may contain {0,3},{0,3} twice.)