Statusneo interview question

Write a string compression algo had some patterns inside it,