Given a string "3(ab)4(cd)" expand it into "abababcdcdcdcd"

This problem was asked in ThoughtWorks interview held in October 2018. Given a string "3(ab)4(cd)", we have to write a program to expand it into "abababcdcdcdcd".

My solution:

Kindly comment below if you have found any error or have a feedback.



Post a Comment