Official algorithmic problem description and constraints.
You are given a string S of length N consisting of lowercase english alphabets.
In one operation, you can:
For example, let the string be codechef. In one operation, you can:
cdeochef.Your task is to find out the number of distinct strings that are possible if you apply the above mentioned operation exactly once.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.