DataDrivenDataDriven
LearnPracticeInterviewDiscussDailyJobs

Everything That Repeats

A easy Python interview practice problem on DataDriven. Write and execute real python code with instant feedback.

Domain
Python
Difficulty
easy
Seniority
L3

Problem

A storage layer holds long status strings where the same character tends to repeat in stretches, and we want a compact form of `s`. Replace each stretch of one repeated character with that character followed by how many times it repeats in a row, and always write the count even when a character shows up just once.

Summary

Say it once, then say how many times it stayed.

Practice This Problem

Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and checks it automatically.

Related

  • All Practice Problems
  • Mock Interview Mode
  • Python Interview Questions
  • Data Engineering Interview Prep Guide
  • Daily Challenge
  • Data Engineering Lessons