insidcode
ProblemsDuelLeaderboardStats
Sign In
  1. Home
  2. Problems
  3. Count how many times a coin lands on heads/tails (use random).

Count how many times a coin lands on heads/tails (use random).

Difficulty: Easy

Phase: 6 · Mixed Logical Challenges

XP Reward: 10 XP

Topics: Mixed Logical Challenges, Easy

Supported Languages: Python, JavaScript, C, C++, Java

Problem Description

Perform basic run-length string compression (e.g., 'aabcccccaaa' -> 'a2b1c5a3'). Input Format: Read input from standard input (stdin). Output Format: Print the result to standard output (stdout).

Constraints

  • -10^9 <= N <= 10^9

Examples

Example 1

Input: aabcccccaaa

Output: a2b1c5a3

Explanation: Sample execution for input aabcccccaaa