Check if there exists a permutation of given string which doesn't ...
Given a string S of lowercase English alphabets, the task is to check if there exists an arrangement of string S such that it doesn’t contain any monotonous substring. A monotonous substring has the following properties: Length os such substring is 2. Both the characters are consecutive, For example – “ab”, “cd”, “dc”, “zy” etc. Examples: