Failing two test cases

i am getting correct output for every string i input
still it is failling test cases .
1.please check the logic of my code and what is wrong with it
2.is there any other approach
code ID:261105

Consider a test case:
sskkkkkkwaerrtss

Expected Output:
s2k6w1a1e1r2t1s2

Your Output:
s4k6w1a1e1r2t1