Company: Amazon_july
Difficulty: medium
Word Conjugates Problem Description Amazon has introduced a tool that explores Word Conjugates in strings built from only the four characters 'a', 'b', 'c' and 'd'. Conjugation follows a fixed pairing: 'a' pairs with 'b', 'c' pairs with 'd', and vice-versa. So there are exactly four valid conjugate pairs: ('a', 'b'), ('b', 'a'), ('c', 'd') and ('d', 'c'). Two strings s and t of the same length n are conjugates of each other if, for every index i with 0 <= i < n, the pair (s[i], t[i]) is one of those four valid conjugate pairs. A substring is called valid if some permutation (rearrangement) of that substring is a conjugate of the substring itself. Given the string s, count the valid substrings of s. Complete the function getConjugatePairs in the editor below. getConjugatePairs has the following parameter: string s : a string containing only the characters 'a', 'b', 'c' and 'd' Returns: long : the total number of valid substrings of s Input Format A single line containing the strin