String Compresion


Here two test cases are failed by this code provided here. Kindly let me know my mistake here in this code.