Intuit OA

Description: Given a String s, a sub-string is defined as a non-empty string that can be obtained by applying following operation

  1. Remove zero or 1 character from left side of s
  2. Remove zero or 1 character from right side of s
  3. Remove zero or 1 character from left & right side of s
    Find how many distinct sub-string possible.

Characters in string are [a-z]
String length can be up to 10^5