cosmos icon indicating copy to clipboard operation
cosmos copied to clipboard

Hackerrank Compress the String solution in C

Open Amitsharma45 opened this issue 6 years ago • 3 comments

This is a(n):

  • [x] New algorithm
  • [ ] Update to an existing algorithm
  • [ ] Error
  • [x] Proposal to the Repository

Details:

In this task, we would like for you to appreciate the usefulness of the groupby() function of itertools. You are given a string . S Suppose a character 'c' occurs consecutively X times in the string. Replace these consecutive occurrences of the character 'c' with (X,c) in the string.

For a better understanding of the problem, check the explanation. Input Format

A single line of input consisting of the string .

Output Format

A single line of output consisting of the modified string.

Constraints

All the characters of denote integers between and . Sample Input=>

1222311

Sample Output=>

(1, 1) (3, 2) (1, 3) (2, 1)

Amitsharma45 avatar May 07 '20 12:05 Amitsharma45

I want to solve this problem.

Amitsharma45 avatar May 07 '20 12:05 Amitsharma45

pls assign this issue to me. I can solve it.

shubha028 avatar May 08 '20 15:05 shubha028

@shubha028 i start work on this issue

Amitsharma45 avatar May 08 '20 17:05 Amitsharma45