Magical string

Problem Name:
Magical string
Site:HackerEarth
Links:
Tags: