apple pie's submission of K - balanced string | CodeChef