Count unique substrings of a string S present in a wraparound string
Given a string S which is an infinite wraparound string of the string "abcdefghijklmnopqrstuvwxyz", the task is to count the number of unique non-empty substrings of a string p are present in s. Examples: Input: S = "zab"Output: 6Explanation: All possible substrings are "z", "a", "b", "za", "ab", "z