Removing Subsequence from concatenated Array
Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article
Given array A formed by the concatenation of string “ABC” one or multiple times. The task for this problem is to remove all occurrences of subsequence “ABC” by performing the following operation a minimum number of times. In one operation swap any two elements of array A. print the number of operations required and elements on which operations are performed in each step.Examples:Input: A = {‘A’, ‘B’, ‘C’}Output: 11 3Explanation:…