Atlassian OA | 25th July 2023 | Maximum number of operations | Get Max coins

Atlassian · Question · Posted Jul 2023

  Question 1 Given a string s of lowercase English characters, the followin operation can be performed on it any number of times. • Choose three consecutive characters s[i],s[i+1] and s[i+2] where (1 <=i<= |s| -2, 1-based indexing) such that s[i]= s[i+1] and s[i+1]!= s[i+2]. Replace s[i+2] with s[i]. • For example, if s= "aabc", then after the operation at /= 1,s="aaac", Find the maximum number of operations that can be applied to s. Example Consider s = "accept". The ...

The full answer & interview discussion are available to premium members.

Log in Create a free account