test case 2 and 3rd are not passed!! but my program is showing correct output for every example.
please check.
Strings(string compression)
u dont have to print 1 when there is single character
STRING COMPRESSION
Take as input S, a string. Write a function that does basic string compression. Print the value returned. E.g. for input “aaabbccds” print out a3b2c2d1s1.
But it is asked in ques.
ok check for this test case
dddddddbbbbbbccccaaa
your ans
d3b6c4a7
expected
d7b6c4a3
Actually ur interger are mismatching with the character
look into this
solved this prblm!!
still 2nd and 3rd case are not passed.
ur code will not pass for the cases where duplicate charater comes
like example
ddddmmmkkkddmm
because ur frequency arrray will maintain for duplicate character only once
sir i m getting correct answer even with duplicate character but still 2 cases are wrong