CISCO coding Q2

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2023-06-30Added By Anonymous
Source: Link
Company: Cisco
Role: unknown
Stage: unknown
Year: unknown
Content: 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 Can anybody tell me the solution how to solve this Please.
Comments