String compression question

it not run two test cases why?

Hello @Ankit_123,

Can you share your code?
It would be easier for me to suggest problems in it.
Steps:
…Paste your code on Online Coding Blocks IDE.
…Save it there.
…Share the link generated.

Still you can check for the following:

  1. whether your code satisfies the constraints mentioned in the question.
    i.e. Would it work for larger strings as per the requirement of the question?

  2. One of the common mistake that students do:
    Eaxmple 1:
    aabbaacc
    Required Output:
    a2b2a2c2
    Wrong Output:
    a4b2c2
    Example 2:
    aabcc
    Required Output:
    a2b1c2
    Wrong Output:
    a2bc2

Hope, this would help.
If you still face any issue, let me know.
Give a like, if you are satisfied.

Hello @Ankit_123,

You are required to share your code with me.
How can I answer if you won’t share it with me.
Steps:
…Paste your code on Online Coding Blocks IDE.
…Save it there.
…Share the link generated.

Waiting for your reply.