Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
534 views
You are given a string and you have to tell number of operations to remove them all
you can remove continuous duplicate at once
example:
input : "aabbaa"
output : 2
first we remove bb then the string becomes aaaa, now we can remove all these at once to total 2 operations
example 2:
input : "abab"
output : 3
we remove suppose a then left with bab
now we remove a again and left with bb
then we remove bb at once to total operation = 3
example 3:
input: "abc"
output : 3

n<=100

Same as this problem. -> https://codeforces.com/problemset/problem/1132/F
in Online Assessments by Expert (108,170 points) | 534 views

Please log in or register to answer this question.

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .