String
Practice
3.8 (25 votes)
Algorithms
Easy
String manipulation
Problem
65% Success 10803 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You are given a String $$S$$ of size $$N$$, consisting of lowercase English characters. Now, you need to select a single English lowercase alphabet, and delete all occurences of it from the given string $$S$$
Considering you do the mentioned exactly once over the given string, what is the minimum possible length of the resultant string ?
Input Format :
The first line contains a single integer N. The next line contains a String $$S$$ of length $$N$$ consisting of lowercase Englsh characters.
Output Format :
Print the required answer on a single line
Constraints :
$$ 1 \le N \le 100, 000 $$
Note that the Expected Output feature of Custom Invocation is not supported for this contest.
Submissions
Please login to view your submissions
Similar Problems
Points:10
57 votes
Tags:
AlgorithmsString Manipulation
Points:10
10 votes
Tags:
AlgorithmsString Manipulation
Editorial