Statusneo Interview Question

Write a string compression algo had some patterns inside it,