No output being printed
Hello @mohammadabdullahjawwad
You should NOT assign things to indices which do NOT exist. Like the length of the string βansβ is zero initially so you cannot use ans[1] = βAβ because index 1 does not exist.
What you can use is ans = ans + βAβ (This appends the character βAβ at the back of the string)
Try to print out the ans.length() at the end of your program, you will get 0 as the length.
Here is the modified code
I am still not getting my answer
On submitting all test cases are being passed except the last one
Hello @mohammadabdullahjawwad
Your code fails on below test case
ak
Your output - a:k
Correct Output - a10k