You are given an integer n and a string s of size n composed of lower case english letters.
You can perform the following operation on it:
Task
You want to minimize the length of the string s.
Find the minimum number of operations that need to be performed to minimize the length of the string s.
Note:
Example
Assumptions :
Approach:
Function Description
Complete the Minimum_Operations function provided in the editor. This function takes the following 2 parameters and returns the required answer:
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
Output format
For each test case in a new line, print the minimum number of operations required to minimize the length of string s.
Constraints
1≤T≤101≤n≤105s contains lowercase english characters
Code snippets (also called starter code/boilerplate code)
This question has code snippets for C, CPP, Java, and Python.
For first test case:
Given
Approach:
For second test case:
Given
Approach: