input=111115
output=5115
how to solve this problem in python?
input=111115
output=5115
how to solve this problem in python?
For further actions, you may consider blocking this person and/or reporting abuse
Faith Bolanle -
Joe -
Dilek Karasoy -
Kedasha -
Once suspended, suneelvarma50 will not be able to comment or publish posts until their suspension is removed.
Once unsuspended, suneelvarma50 will be able to comment and publish posts again.
Once unpublished, all posts by suneelvarma50 will become hidden and only accessible to themselves.
If suneelvarma50 is not suspended, they can still re-publish their posts from their dashboard.
Once unpublished, this post will become invisible to the public and only accessible to suneelvarma.
They can still re-publish the post if they are not suspended.
Thanks for keeping DEV Community safe. Here is what you can do to flag suneelvarma50:
Unflagging suneelvarma50 will restore default visibility to their posts.
Top comments (1)
1) Converting the number to a string
2) Using
itertools.groupby
to group each subsequent repeating digit3) Concatenating each grouped digit with the size of its group
4) Concatenating the whole thing to one string
(I interpreted the question so that the expected output for 151 is 111511 and not 2115).