Why this code is giving not sesired aoutpu? Question from leetcode?

question : https://leetcode.com/contest/weekly-contest-183/problems/longest-happy-string/
my sol :https://ide.codingblocks.com/s/276732

My solution is not giving error on sublime ??? and giving run error in leetcode??
not running for 1 1 7 why ?? i am litterally stuck ??
leetcode is giving compilation error?? why??

hey @ssanjuchandra
please share code that i can directly code paste in here

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.