Goldman Sachs | +2 years experience
Anonymous User
6029

The question states optimize input in such a way that repeating pattern is replaced with "*"
Example :
input - "ABABCABABCD"
output - "AB*C*D"
Explanation -
Here, till "AB*" of the output, "AB" repeats twice, but till "AB*C*" , "ABABC" repeats twice in the input string

Comments (16)