3 AnswersNew Answer
An outline would be- 1. Iterate through the string. 2. When a new letter is found, add the letter to the output string and then add the count of the letter in the string to the output string.
No i tried but i didnt getting logic for count can u please tell me code
Can you show your attempt pls? You are already asked similar question.. So can code with information from that. Give a try, You can convert to char array or use charAt() method... Read string in a loop, if i'th char ==i+1 char increase count, continue Else print i'th char and count, reset count=0, then continue with next charecters... If you struck between, then share code,...