Rajiv's Lucky Strings
Practice
1 (1 votes)
Medium
Problem
3% Success 123 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code
Rajiv has a string S. He considers a string T lucky for him if he can derive it from S by removing exactly 2 characters. You being his best friend have to find out the number of unique lucky strings when a string S is given.
Input
The first line of the input contains a string S.
Output
You have to print the total number of unique lucky strings formed using S.
Constraints
3<=|S|<=106
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
5 votes
Tags:
Ad-HocAlgorithmsMediumDynamic ProgrammingDynamic programming
Points:30
2 votes
Tags:
Binary search algorithmDynamic ProgrammingMediumAlgorithmsDepth-first searchDynamic programmingDisjoint set
Points:30
2 votes
Tags:
MediumDynamic programming
Editorial
No editorial available for this problem.